1 | <?php |
||
27 | class ImplementationSystem extends System |
||
28 | { |
||
29 | /** |
||
30 | * @param Definition|ProvidesInterfaces|HasInterfaces $parent |
||
31 | * @param RuleInterface|ProvidesInterfaceNodes $ast |
||
32 | */ |
||
33 | 119 | public function resolve(Definition $parent, RuleInterface $ast): void |
|
51 | |||
52 | /** |
||
53 | * @param ProvidesInterfaces|HasInterfaces|TypeDefinition $parent |
||
54 | * @param TypeNameNode $ast |
||
55 | * @throws \Railt\Io\Exception\ExternalFileException |
||
56 | * @throws \Railt\Reflection\Exception\TypeNotFoundException |
||
57 | */ |
||
58 | private function implement(ProvidesInterfaces $parent, TypeNameNode $ast): void |
||
74 | |||
75 | /** |
||
76 | * @param ObjectDefinition $object |
||
77 | * @param InterfaceDefinition $interface |
||
78 | */ |
||
79 | private function verifyFieldsInheritance(ObjectDefinition $object, InterfaceDefinition $interface): void |
||
83 | |||
84 | /** |
||
85 | * @param Definition $parent |
||
86 | * @param TypeDefinition $definition |
||
87 | * @throws TypeConflictException |
||
88 | */ |
||
89 | private function verifyIsInterface(Definition $parent, TypeDefinition $definition): void |
||
96 | |||
97 | /** |
||
98 | * @param ProvidesInterfaces $parent |
||
99 | * @param TypeDefinition $interface |
||
100 | * @throws TypeConflictException |
||
101 | */ |
||
102 | private function verifyInterfaceDuplication(ProvidesInterfaces $parent, TypeDefinition $interface): void |
||
110 | |||
111 | /** |
||
112 | * @param ProvidesInterfaces $parent |
||
113 | * @param TypeDefinition $interface |
||
114 | * @throws TypeConflictException |
||
115 | */ |
||
116 | private function verifySelfReferenceImplementation(ProvidesInterfaces $parent, TypeDefinition $interface): void |
||
126 | } |
||
127 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: