1 | <?php |
||
27 | final class Method extends AbstractFactory implements ProjectFactoryStrategy |
||
28 | { |
||
29 | /** |
||
30 | * Returns true when the strategy is able to handle the object. |
||
31 | * |
||
32 | * @param object $object object to check. |
||
33 | * @return boolean |
||
34 | */ |
||
35 | public function matches($object) |
||
39 | |||
40 | /** |
||
41 | * Creates an MethodDescriptor out of the given object including its child elements. |
||
42 | * |
||
43 | * @param object $object object to convert to an MethodDescriptor |
||
44 | * @param StrategyContainer $strategies used to convert nested objects. |
||
45 | * @param Context $context of the created object |
||
46 | * @return MethodDescriptor |
||
47 | */ |
||
48 | public function doCreate($object, StrategyContainer $strategies, Context $context = null) |
||
67 | 3 | ||
68 | 3 | /** |
|
69 | 3 | * Converts the visibility of the method to a valid Visibility object. |
|
70 | * |
||
71 | 3 | * @param ClassMethod $node |
|
72 | 1 | * @return Visibility |
|
73 | 1 | */ |
|
74 | 3 | private function buildVisibility(ClassMethod $node) |
|
84 | } |
||
85 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.