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

AdminUserSeeder::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
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
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
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
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
Consider adding a comment why this CATCH block is empty.
Loading history...
24
25
        }
26
    }
27
}