1 | <?php |
||
16 | abstract class ClassDiscovery |
||
17 | { |
||
18 | /** |
||
19 | * A list of strategies to find classes. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | private static $strategies = [ |
||
24 | Strategy\PuliBetaStrategy::class, |
||
25 | Strategy\CommonClassesStrategy::class, |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Discovery cache to make the second time we use discovery faster. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | private static $cache = []; |
||
34 | |||
35 | /** |
||
36 | * Finds a class. |
||
37 | * |
||
38 | * @param string $type |
||
39 | * |
||
40 | * @return string |
||
41 | * |
||
42 | * @throws DiscoveryFailedException |
||
43 | */ |
||
44 | protected static function findOneByType($type) |
||
76 | |||
77 | /** |
||
78 | * Get a value from cache. |
||
79 | * |
||
80 | * @param string $type |
||
81 | * |
||
82 | * @return string|null |
||
83 | */ |
||
84 | private static function getFromCache($type) |
||
97 | |||
98 | /** |
||
99 | * Store a value in cache. |
||
100 | * |
||
101 | * @param string $type |
||
102 | * @param string $class |
||
103 | */ |
||
104 | private static function storeInCache($type, $class) |
||
108 | |||
109 | /** |
||
110 | * Set new strategies and clear the cache. |
||
111 | * |
||
112 | * @param DiscoveryStrategy[] $strategies |
||
113 | */ |
||
114 | public static function setStrategies(array $strategies) |
||
119 | |||
120 | /** |
||
121 | * Append a strategy at the end of the strategy queue. |
||
122 | * |
||
123 | * @param DiscoveryStrategy $strategy |
||
124 | */ |
||
125 | public static function appendStrategy(DiscoveryStrategy $strategy) |
||
130 | |||
131 | /** |
||
132 | * Prepend a strategy at the beginning of the strategy queue. |
||
133 | * |
||
134 | * @param DiscoveryStrategy $strategy |
||
135 | */ |
||
136 | public static function prependStrategy(DiscoveryStrategy $strategy) |
||
141 | |||
142 | /** |
||
143 | * Clear the cache. |
||
144 | */ |
||
145 | public static function clearCache() |
||
149 | |||
150 | /** |
||
151 | * Evaulates conditions to boolean. |
||
152 | * |
||
153 | * @param mixed $condition |
||
154 | * |
||
155 | * @return bool |
||
156 | */ |
||
157 | protected static function evaluateCondition($condition) |
||
179 | } |
||
180 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..