PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.1.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.1.0
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
← All changes | vendor/wpfluent/framework/src/WPFluent/Container/BoundMethod.php +18 -7 1.412.1.0 View file →
@@ -22,22 +22,32 @@
22 22 *
23 23 * @throws \ReflectionException
24 24 * @throws \InvalidArgumentException
25 25 */
26 - public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
26 + public static function call(
27 + $container, $callback, array $parameters = [], $defaultMethod = null
28 + )
27 29 {
28 - if (is_string($callback) && ! $defaultMethod && method_exists($callback, '__invoke')) {
30 + if (
31 + is_string($callback)
32 + && ! $defaultMethod
33 + && method_exists($callback, '__invoke')
34 + ) {
29 35 $defaultMethod = '__invoke';
30 36 }
31 37
32 38 if (static::isCallableWithAtSign($callback) || $defaultMethod) {
33 - return static::callClass($container, $callback, $parameters, $defaultMethod);
39 + return static::callClass(
40 + $container, $callback, $parameters, $defaultMethod
41 + );
34 42 }
35 43
36 44 return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
37 45 return $callback(
38 46 ...array_values(
39 - static::getMethodDependencies($container, $callback, $parameters)
47 + static::getMethodDependencies(
48 + $container, $callback, $parameters
49 + )
40 50 )
41 51 );
42 52 });
43 53 }
@@ -52,9 +62,11 @@
52 62 * @return mixed
53 63 *
54 64 * @throws \InvalidArgumentException
55 65 */
56 - protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null)
66 + protected static function callClass(
67 + $container, $target, array $parameters = [], $defaultMethod = null
68 + )
57 69 {
58 70 $segments = explode('@', $target);
59 71
60 72 // We will assume an @ sign is used to delimit the class name from the method
@@ -59,10 +71,9 @@
59 71
60 72 // We will assume an @ sign is used to delimit the class name from the method
61 73 // name. We will split on this @ sign and then build a callable array that
62 74 // we can pass right back into the "call" method for dependency binding.
63 - $method = count($segments) === 2
64 - ? $segments[1] : $defaultMethod;
75 + $method = count($segments) === 2 ? $segments[1] : $defaultMethod;
65 76
66 77 if (is_null($method)) {
67 78 throw new InvalidArgumentException('Method not provided.');
68 79 }