1 | <?php |
||
23 | abstract class CoffeeMaker implements CoffeeMakerInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Indicates that CoffeeMaker should construct a NEW entity instance from the provided arguments (if given) |
||
28 | */ |
||
29 | const BREW_NEW = 'new'; |
||
30 | |||
31 | /** |
||
32 | * Indicates that CoffeeMaker should always return a SHARED instance |
||
33 | */ |
||
34 | const BREW_SHARED = 'shared'; |
||
35 | |||
36 | /** |
||
37 | * Indicates that CoffeeMaker should only load the file/class/interface but NOT instantiate |
||
38 | */ |
||
39 | const BREW_LOAD_ONLY = 'load_only'; |
||
40 | |||
41 | |||
42 | /** |
||
43 | * @var CoffeePotInterface $coffee_pot |
||
44 | */ |
||
45 | private $coffee_pot; |
||
46 | |||
47 | /** |
||
48 | * @var DependencyInjector $injector |
||
49 | */ |
||
50 | private $injector; |
||
51 | |||
52 | |||
53 | |||
54 | /** |
||
55 | * @return array |
||
56 | */ |
||
57 | public static function getTypes() |
||
68 | |||
69 | |||
70 | |||
71 | /** |
||
72 | * @param $type |
||
73 | * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
||
74 | */ |
||
75 | public static function validateType($type) |
||
89 | |||
90 | |||
91 | |||
92 | /** |
||
93 | * CoffeeMaker constructor. |
||
94 | * |
||
95 | * @param CoffeePotInterface $coffee_pot |
||
96 | * @param InjectorInterface $injector |
||
97 | */ |
||
98 | public function __construct(CoffeePotInterface $coffee_pot, InjectorInterface $injector) |
||
103 | |||
104 | |||
105 | |||
106 | /** |
||
107 | * @return \EventEspresso\core\services\container\CoffeePotInterface |
||
108 | */ |
||
109 | protected function coffeePot() |
||
113 | |||
114 | |||
115 | |||
116 | /** |
||
117 | * @return \EventEspresso\core\services\container\DependencyInjector |
||
118 | */ |
||
119 | protected function injector() |
||
123 | |||
124 | |||
125 | |||
126 | /** |
||
127 | * Examines the constructor to determine which method should be used for instantiation |
||
128 | * |
||
129 | * @param \ReflectionClass $reflector |
||
130 | * @return mixed |
||
131 | * @throws InstantiationException |
||
132 | */ |
||
133 | protected function resolveInstantiationMethod(\ReflectionClass $reflector) |
||
149 | |||
150 | |||
151 | |||
152 | /** |
||
153 | * Ensures files for classes that are not PSR-4 compatible are loaded |
||
154 | * and then verifies that classes exist where applicable |
||
155 | * |
||
156 | * @param RecipeInterface $recipe |
||
157 | * @return bool |
||
158 | * @throws InvalidClassException |
||
159 | */ |
||
160 | protected function resolveClassAndFilepath(RecipeInterface $recipe) |
||
182 | |||
183 | |||
184 | |||
185 | |||
186 | } |
||
187 | // End of file CoffeeMaker.php |
||
188 | // Location: /CoffeeMaker.php |
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 given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.