| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | protected function checkProjectPermission($class, $method, $project_id) |
||
| 48 | { |
||
| 49 | if (empty($project_id)) { |
||
| 50 | throw new AccessDeniedException('Project not found'); |
||
| 51 | } |
||
| 52 | |||
| 53 | $role = $this->projectUserRoleModel->getUserRole($project_id, $this->userSession->getId()); |
||
| 54 | |||
| 55 | if (!$this->apiProjectAuthorization->isAllowed($class, $method, $role)) { |
||
| 56 | throw new AccessDeniedException('Project access denied'); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
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.