1 | <?php |
||
10 | class Permissions |
||
11 | { |
||
12 | /** |
||
13 | * @var Db |
||
14 | */ |
||
15 | protected $db; |
||
16 | /** |
||
17 | * @var Config |
||
18 | */ |
||
19 | protected $config; |
||
20 | |||
21 | /** |
||
22 | * Permissions constructor. |
||
23 | * @param Db $db |
||
24 | * @param Config $config |
||
25 | */ |
||
26 | public function __construct(Db $db, Config $config) |
||
31 | |||
32 | /** |
||
33 | * @param $userID |
||
34 | * @param $serverID |
||
35 | * @return int|string |
||
36 | */ |
||
37 | public function get($userID, $serverID) |
||
47 | |||
48 | /** |
||
49 | * @param $userID |
||
50 | * @param $serverID |
||
51 | * @param $permission |
||
52 | */ |
||
53 | public function set($userID, $serverID, $permission) |
||
57 | |||
58 | } |
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.