| 1 | <?php |
||
| 7 | class SecurityHelper extends AbstractSymfonyHelper |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Pretend user is logged in |
||
| 11 | * |
||
| 12 | * @param $username |
||
| 13 | */ |
||
| 14 | public function amLoggedInAs($username) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Checks if the attributes are granted against the current authentication token |
||
| 39 | * |
||
| 40 | * @param mixed $attributes |
||
| 41 | */ |
||
| 42 | public function seeIsGranted($attributes) |
||
| 48 | } |
||
| 49 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: