Skip to content

Commit 69b95d9

Browse files
committed
style fixes
1 parent c9d471a commit 69b95d9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/Utilities/Helper.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ protected static function isItemOrderInvalid($item, $array)
5555
}
5656

5757
/**
58-
* Gets the parameter of a callable thing (from is_callable) and returns it's arguments using reflection
58+
* Gets the parameter of a callable thing (from is_callable) and returns it's arguments using reflection.
5959
*
60-
* @param callable $callable
60+
* @param callable $callable
6161
* @return \ReflectionParameter[]
62+
*
6263
* @throws \ReflectionException
6364
* @throws \InvalidArgumentException
6465
*/
@@ -70,14 +71,14 @@ private static function reflectCallableParameters($callable)
7071
*/
7172
if ($callable instanceof Closure) {
7273
$reflection = new ReflectionFunction($callable);
73-
} else if (is_string($callable) && function_exists($callable)) {
74+
} elseif (is_string($callable) && function_exists($callable)) {
7475
$reflection = new ReflectionFunction($callable);
75-
} else if (is_string($callable) && str_contains($callable, '::')) {
76+
} elseif (is_string($callable) && str_contains($callable, '::')) {
7677
$reflection = new ReflectionMethod($callable);
77-
} else if (is_object($callable) && method_exists($callable, '__invoke')) {
78+
} elseif (is_object($callable) && method_exists($callable, '__invoke')) {
7879
$reflection = new ReflectionMethod($callable, '__invoke');
7980
} else {
80-
throw new \InvalidArgumentException("argument is not callable or the code is wrong");
81+
throw new \InvalidArgumentException('argument is not callable or the code is wrong');
8182
}
8283

8384
return $reflection->getParameters();

tests/Unit/HelperTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ public function test_compile_content_function()
116116

117117
public function test_compile_content_callable_class()
118118
{
119-
$content = new class {
119+
$content = new class
120+
{
120121
public function __invoke($obj)
121122
{
122123
return $obj->id;

0 commit comments

Comments
 (0)