| @@ 72-88 (lines=17) @@ | ||
| 69 | * |
|
| 70 | * @return array [index => [name, class]] |
|
| 71 | */ |
|
| 72 | public static function getParameters(string $classFqcn, string $method): array |
|
| 73 | { |
|
| 74 | try { |
|
| 75 | $reflectionMethod = new ReflectionMethod($classFqcn, $method); |
|
| 76 | } catch (ReflectionException $e) { |
|
| 77 | return []; |
|
| 78 | } |
|
| 79 | ||
| 80 | foreach ($reflectionMethod->getParameters() as $index => $param) { |
|
| 81 | $reflectionParameters[$index]['name'] = $param->getName(); |
|
| 82 | if (null !== $param->getClass()) { |
|
| 83 | $reflectionParameters[$index]['class'] = $param->getClass()->name; |
|
| 84 | } |
|
| 85 | } |
|
| 86 | ||
| 87 | return $reflectionParameters ?? []; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * @return ReflectionProperty[] |
|
| @@ 71-87 (lines=17) @@ | ||
| 68 | * |
|
| 69 | * @return array [index => [name, class]] |
|
| 70 | */ |
|
| 71 | public static function getParameters($input): array |
|
| 72 | { |
|
| 73 | try { |
|
| 74 | $reflectionMethod = self::getCallableReflectionMethod($input); |
|
| 75 | } catch (ReflectionException $e) { |
|
| 76 | return []; |
|
| 77 | } |
|
| 78 | ||
| 79 | foreach ($reflectionMethod->getParameters() as $index => $param) { |
|
| 80 | $reflectionParameters[$index]['name'] = $param->getName(); |
|
| 81 | if (null !== $param->getClass()) { |
|
| 82 | $reflectionParameters[$index]['class'] = $param->getClass()->name; |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | return $reflectionParameters ?? []; |
|
| 87 | } |
|
| 88 | ||
| 89 | /** |
|
| 90 | * @throws InvalidArgumentException |
|