| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function run() |
||
| 20 | { |
||
| 21 | $adminRole = new Role(); |
||
| 22 | $adminRole->name = 'admin'; |
||
|
|
|||
| 23 | $adminRole->display_name = 'Administrator'; |
||
| 24 | $adminRole->save(); |
||
| 25 | |||
| 26 | $accessDashboardPermission = new Permission(); |
||
| 27 | $accessDashboardPermission->name = 'access-dashboard'; |
||
| 28 | $accessDashboardPermission->display_name = 'Access the Admins Dashboard'; |
||
| 29 | $accessDashboardPermission->save(); |
||
| 30 | |||
| 31 | $adminRole->attachPermission($accessDashboardPermission); |
||
| 32 | |||
| 33 | $admin = new User(); |
||
| 34 | $admin->name = 'Super Admin'; |
||
| 35 | $admin->email = '[email protected]'; |
||
| 36 | $admin->password = Hash::make('admin'); |
||
| 37 | $admin->save(); |
||
| 38 | |||
| 39 | $admin->attachRole($adminRole); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
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.