1 | <?php |
||
10 | class Entity extends Provider |
||
11 | { |
||
12 | /** |
||
13 | * @param string $name |
||
14 | * |
||
15 | * @return string |
||
16 | */ |
||
17 | public function get($name) |
||
27 | |||
28 | /** |
||
29 | * Format a full class name from an entity name |
||
30 | * |
||
31 | * @param string $name |
||
32 | * |
||
33 | * @return string|null |
||
34 | */ |
||
35 | private function format($name) |
||
45 | |||
46 | /** |
||
47 | * Search for an entity implementation in the module stack |
||
48 | * |
||
49 | * @param string $name |
||
50 | * @param int $bit |
||
51 | * |
||
52 | * @return bool|null|string |
||
53 | */ |
||
54 | private function find($name, $bit) |
||
72 | |||
73 | /** |
||
74 | * Check whether a module has an entity declared, if so, either load the |
||
75 | * entity class, or fall back to the basic salt |
||
76 | * |
||
77 | * @param Module|string $module |
||
78 | * @param string $name |
||
79 | * @param int $bit |
||
80 | * |
||
81 | * @return bool|string |
||
82 | */ |
||
83 | private function fromModule($module, $name, $bit) |
||
95 | |||
96 | /** |
||
97 | * Get Entity class name from a name plus a module |
||
98 | * |
||
99 | * @param string $name |
||
100 | * @param Module $module |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | private function getEntityClass($name, $module) |
||
108 | } |
||
109 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.