| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class User extends Filter{ |
||
| 6 | |||
| 7 | public function user_in(): bool |
||
| 8 | { |
||
| 9 | /* Set message to be displayed in case of error */ |
||
| 10 | $this->addMessage('user_in','User required to be logged in.'); |
||
| 11 | |||
| 12 | /* OPTIONAL: Defines function to be executed before the error is returned to the client */ |
||
| 13 | $this->addTreat('user_in','report_notLogged'); |
||
| 14 | |||
| 15 | /* Test something and return your result */ |
||
| 16 | return (array_key_exists('user',$_SESSION)); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function report_notLogged(): void |
||
| 21 | /* Do something before the error is returned to the client */ |
||
| 22 | } |
||
| 28 |