1 | <?php |
||
17 | class App extends ActiveModel |
||
18 | { |
||
19 | /** |
||
20 | * Get all objects with query caching |
||
21 | * @return \Illuminate\Database\Eloquent\Collection|static |
||
22 | * @throws SyntaxException |
||
23 | */ |
||
24 | public static function getAll() |
||
39 | |||
40 | /** |
||
41 | * Get all object by defined $type with caching query in memory |
||
42 | * @param $type |
||
43 | * @return array|null |
||
44 | * @throws SyntaxException |
||
45 | */ |
||
46 | public static function getAllByType($type) |
||
57 | |||
58 | /** |
||
59 | * Get single row by defined type and sys_name with query caching |
||
60 | * @param string $type |
||
61 | * @param string $sys_name |
||
62 | * @return mixed|null |
||
63 | * @throws SyntaxException |
||
64 | */ |
||
65 | public static function getItem($type, $sys_name) |
||
75 | |||
76 | /** |
||
77 | * Get application configs |
||
78 | * @param string $type |
||
79 | * @param string $name |
||
80 | * @return array|null|string |
||
81 | * @throws SyntaxException |
||
82 | */ |
||
83 | public static function getConfigs($type, $name) |
||
93 | |||
94 | /** |
||
95 | * Get localized application name |
||
96 | * @return string |
||
97 | * @throws SyntaxException |
||
98 | */ |
||
99 | public function getLocaleName() |
||
113 | |||
114 | /** |
||
115 | * Check if app version match db version of this app |
||
116 | * @return bool |
||
117 | * @throws SyntaxException |
||
118 | */ |
||
119 | public function checkVersion() |
||
129 | |||
130 | /** |
||
131 | * Get extension script version if exists |
||
132 | * @return bool|float |
||
133 | */ |
||
134 | public function getScriptVersion() |
||
147 | |||
148 | } |
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.