1 | <?php |
||
19 | final class ProxiedMethodsFilter |
||
20 | { |
||
21 | /** @var array<int, string> */ |
||
22 | private static $defaultExcluded = [ |
||
23 | '__get', |
||
24 | '__set', |
||
25 | '__isset', |
||
26 | '__unset', |
||
27 | '__clone', |
||
28 | '__sleep', |
||
29 | '__wakeup', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * @param ReflectionClass $class reflection class from which methods should be extracted |
||
34 | * @param array<int, string> $excluded methods to be ignored |
||
35 | * |
||
36 | * @return ReflectionMethod[] |
||
37 | */ |
||
38 | 16 | public static function getProxiedMethods(ReflectionClass $class, ?array $excluded = null) : array |
|
39 | { |
||
40 | 16 | return self::doFilter($class, $excluded ?? self::$defaultExcluded); |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param ReflectionClass $class reflection class from which methods should be extracted |
||
45 | * @param array<int, string> $excluded methods to be ignored |
||
46 | * |
||
47 | * @return ReflectionMethod[] |
||
48 | */ |
||
49 | 8 | public static function getAbstractProxiedMethods(ReflectionClass $class, ?array $excluded = null) : array |
|
50 | { |
||
51 | 8 | return self::doFilter($class, $excluded ?? self::$defaultExcluded, true); |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param array<int, string> $excluded |
||
56 | * |
||
57 | * @return array<int, ReflectionMethod> |
||
|
|||
58 | */ |
||
59 | 24 | private static function doFilter(ReflectionClass $class, array $excluded, bool $requireAbstract = false) : array |
|
73 | |||
74 | /** |
||
75 | * Checks whether the method cannot be proxied |
||
76 | */ |
||
77 | 14 | private static function methodCannotBeProxied(ReflectionMethod $method) : bool |
|
81 | } |
||
82 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.