| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | public function run() |
||
| 7 | { |
||
| 8 | Role::create([ |
||
| 9 | 'name' => 'admin', |
||
| 10 | 'description' => 'Администратор', |
||
| 11 | ]); |
||
| 12 | Role::create([ |
||
| 13 | 'name' => 'user', |
||
| 14 | 'description' => 'Пользователь', |
||
| 15 | ]); |
||
| 16 | |||
| 17 | $user = new User(); |
||
| 18 | |||
| 19 | $user->email = '[email protected]'; |
||
| 20 | $user->full_name = 'Администратор'; |
||
| 21 | $user->password = password_hash('qwerty', PASSWORD_DEFAULT, ['cost' => 13]); |
||
| 22 | $user->role_id = User::ROLE_ADMIN; |
||
| 23 | $user->status = User::STATUS_ACTIVE; |
||
| 24 | $user->save(); |
||
| 25 | |||
| 26 | $user = new User(); |
||
| 27 | |||
| 28 | $user->email = '[email protected]'; |
||
| 29 | $user->full_name = 'Пользователь'; |
||
| 30 | $user->password = password_hash('qwerty', PASSWORD_DEFAULT, ['cost' => 13]); |
||
| 31 | $user->role_id = User::ROLE_USER; |
||
| 32 | $user->status = User::STATUS_ACTIVE; |
||
| 33 | $user->save(); |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.