Completed
Push — master ( f7b1d9...1d2285 )
by Sergi Tur
26:58
created

AdminUserSeeder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 2
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
/**
6
 * Class AdminUserSeeder
7
 */
8
class AdminUserSeeder extends Seeder
0 ignored issues
show
Coding Style Compatibility introduced by Sergi Tur Badenas
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
9
{
10
    /**
11
     * Run the database seeds.
12
     *
13
     * @return void
14
     */
15
    public function run()
16
    {
17
        try {
18
            factory(App\User::class)->create([
19
                    "name" => env('ADMIN_USER', "$USER_NAME$"),
0 ignored issues
show
Bug introduced by Sergi Tur Badenas
The variable $USER_NAME does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
20
                    "email" => env('ADMIN_EMAIL', "$USER_EMAIL"),
0 ignored issues
show
Bug introduced by Sergi Tur Badenas
The variable $USER_EMAIL does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
21
                    "password" => bcrypt(env('ADMIN_PWD', '123456'))]
22
            );
23
        } catch (\Illuminate\Database\QueryException $exception) {
0 ignored issues
show
Coding Style Comprehensibility introduced by Sergi Tur Badenas
Consider adding a comment why this CATCH block is empty.
Loading history...
24
25
        }
26
    }
27
}