1 | <?php |
||
33 | class PermissionsProvider implements IPermissionsProvider |
||
34 | { |
||
35 | /** |
||
36 | * Implement nette smart magic |
||
37 | */ |
||
38 | use Nette\SmartObject; |
||
39 | |||
40 | /** |
||
41 | * @var Entities\IPermission[] |
||
42 | */ |
||
43 | private $permissions = []; |
||
44 | |||
45 | /** |
||
46 | * @param Entities\IResource|NULL $resource |
||
47 | * @param string|NULL $privilege |
||
48 | * @param array|NULL $details |
||
49 | * @param callable|NULL $assertion |
||
50 | * |
||
51 | * @return Entities\IPermission |
||
52 | */ |
||
53 | public function addPermission(Entities\IResource $resource = NULL, string $privilege = NULL, array $details = NULL, callable $assertion = NULL) : Entities\IPermission |
||
65 | |||
66 | /** |
||
67 | * @param string $id |
||
68 | * |
||
69 | * @return Entities\IPermission |
||
70 | */ |
||
71 | public function getPermission(string $id) : Entities\IPermission |
||
79 | |||
80 | /** |
||
81 | * @return Entities\IPermission[] |
||
82 | */ |
||
83 | public function findAll() : array |
||
87 | } |
||
88 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.