| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function run() |
||
| 18 | { |
||
| 19 | $admin = new Role(); |
||
| 20 | $admin->name = 'admin'; |
||
|
|
|||
| 21 | $admin->display_name = 'Administrator'; |
||
| 22 | $admin->save(); |
||
| 23 | |||
| 24 | $listUsers = new Permission(); |
||
| 25 | $listUsers->name = 'list-users'; |
||
| 26 | $listUsers->display_name = 'List all Users'; |
||
| 27 | $listUsers->save(); |
||
| 28 | |||
| 29 | $admin->attachPermission($listUsers); |
||
| 30 | } |
||
| 31 | } |
||
| 32 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.