| Conditions | 8 |
| Paths | 15 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 5 |
| Ratio | 27.78 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function execute() |
||
| 25 | { |
||
| 26 | $controller = strtolower($this->router->getController()); |
||
|
|
|||
| 27 | $action = strtolower($this->router->getAction()); |
||
| 28 | $ignore = ($controller === 'profile/twofactorcontroller' && in_array($action, ['code', 'check'])) || ($controller === 'auth/authcontroller' && $action === 'logout'); |
||
| 29 | |||
| 30 | if ($ignore === false && $this->userSession->hasPostAuthentication() && !$this->userSession->isPostAuthenticationValidated()) { |
||
| 31 | $this->nextMiddleware = null; |
||
| 32 | |||
| 33 | View Code Duplication | if ($this->request->isAjax()) { |
|
| 34 | $this->response->text('Not Authorized', 401); |
||
| 35 | } else { |
||
| 36 | $this->response->redirect($this->helper->url->to('Profile/TwoFactorController', 'code')); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | $this->next(); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.