PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.5
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.5
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / rosell-dk / locate-binaries / tests / MethodInvoker.php

MethodInvoker.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/rosell-dk/locate-binaries/tests/MethodInvoker.php

22 lines 537 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace LocateBinaries\Tests;
4
5 class MethodInvoker
6 {
7 public static function invoke($object, string $methodName, array $args=[]) {
8 $privateMethod = self::getMethod(get_class($object), $methodName);
9
10 return $privateMethod->invokeArgs($object, $args);
11 }
12
13 private static function getMethod(string $className, string $methodName) {
14 $class = new \ReflectionClass($className);
15
16 $method = $class->getMethod($methodName);
17 $method->setAccessible(true);
18
19 return $method;
20 }
21 }
22