1 | <?php |
||
15 | abstract class AbstractModule |
||
16 | { |
||
17 | /** |
||
18 | * @var Matcher |
||
19 | */ |
||
20 | protected $matcher; |
||
21 | |||
22 | /** |
||
23 | * @var AbstractModule|null |
||
24 | */ |
||
25 | protected $lastModule; |
||
26 | |||
27 | /** |
||
28 | * @var Container |
||
29 | */ |
||
30 | private $container; |
||
31 | |||
32 | 52 | public function __construct( |
|
41 | |||
42 | 1 | public function __toString() |
|
46 | |||
47 | /** |
||
48 | * Install module |
||
49 | */ |
||
50 | 42 | public function install(self $module) |
|
54 | |||
55 | /** |
||
56 | * Override module |
||
57 | */ |
||
58 | 1 | public function override(self $module) |
|
63 | |||
64 | /** |
||
65 | * Return container |
||
66 | * |
||
67 | * @return Container |
||
68 | */ |
||
69 | 53 | public function getContainer() : Container |
|
77 | |||
78 | /** |
||
79 | * Bind interceptor |
||
80 | * |
||
81 | * @param AbstractMatcher $classMatcher |
||
82 | * @param AbstractMatcher $methodMatcher |
||
83 | * @param string[] $interceptors |
||
84 | */ |
||
85 | 42 | public function bindInterceptor(AbstractMatcher $classMatcher, AbstractMatcher $methodMatcher, array $interceptors) |
|
93 | |||
94 | /** |
||
95 | * Bind interceptor early |
||
96 | * |
||
97 | * @param AbstractMatcher $classMatcher |
||
98 | * @param AbstractMatcher $methodMatcher |
||
99 | * @param array $interceptors |
||
100 | */ |
||
101 | 1 | public function bindPriorityInterceptor(AbstractMatcher $classMatcher, AbstractMatcher $methodMatcher, array $interceptors) |
|
109 | |||
110 | /** |
||
111 | * Rename binding name |
||
112 | * |
||
113 | * @param string $interface Interface |
||
114 | * @param string $newName New binding name |
||
115 | * @param string $sourceName Original binding name |
||
116 | * @param string $targetInterface Original interface |
||
117 | */ |
||
118 | 1 | public function rename(string $interface, string $newName, string $sourceName = Name::ANY, string $targetInterface = '') |
|
125 | |||
126 | /** |
||
127 | * Configure binding |
||
128 | */ |
||
129 | abstract protected function configure(); |
||
130 | |||
131 | /** |
||
132 | * Bind interface |
||
133 | */ |
||
134 | 51 | protected function bind(string $interface = '') : Bind |
|
138 | |||
139 | /** |
||
140 | * Activate bindings |
||
141 | */ |
||
142 | 53 | private function activate() |
|
148 | } |
||
149 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.