Conditions | 2 |
Paths | 1 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
53 | public static function getMethods(string $className): Collection |
||
54 | { |
||
55 | $class = new ReflectionClass($className); |
||
56 | |||
57 | return Collection::make($class->getMethods(ReflectionMethod::IS_PUBLIC)) |
||
58 | ->merge(Collection::make($class->getTraits()) |
||
59 | ->map(static function (ReflectionClass $trait) { |
||
60 | return Collection::make( |
||
61 | $trait->getMethods(ReflectionMethod::IS_PUBLIC) |
||
62 | ); |
||
63 | })->flatten() |
||
64 | ) |
||
65 | ->reject(static function (ReflectionMethod $method) use ($className) { |
||
66 | return $method->class !== $className || $method->getNumberOfParameters() > 0; |
||
67 | }); |
||
68 | } |
||
69 | } |
||
70 |