Passed
Pull Request — master (#48)
by Brian
02:46
created

SellerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 34
ccs 8
cts 11
cp 0.7272
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A definition() 0 8 1
A unverified() 0 4 1
1
<?php
2
3
namespace App\Modules\Sellers\Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
6
use Illuminate\Support\Str;
7
8
/**
9
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Modules\Sellers\Models\Seller>
10
 */
11
class SellerFactory extends Factory
12
{
13
    /**
14
     * The name of the factory's corresponding model.
15
     *
16
     * @var class-string<\Illuminate\Database\Eloquent\Model|TModel>
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<\Illuminate...\Eloquent\Model|TModel> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<\Illuminate\Database\Eloquent\Model|TModel>.
Loading history...
17
     */
18
    protected $model = \App\Modules\Sellers\Models\Seller::class;
19
20
    /**
21
     * Define the model's default state.
22
     *
23
     * @return array<string, mixed>
24
     */
25 22
    public function definition(): array
26
    {
27 22
        return [
28 22
            'name' => fake()->name(),
29 22
            'email' => fake()->unique()->safeEmail(),
30 22
            'email_verified_at' => now(),
31 22
            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
32 22
            'remember_token' => Str::random(10),
33 22
        ];
34
    }
35
36
    /**
37
     * Indicate that the model's email address should be unverified.
38
     *
39
     * @return $this
40
     */
41
    public function unverified(): static
42
    {
43
        return $this->state(fn (array $attributes) => [
0 ignored issues
show
Unused Code introduced by
The parameter $attributes is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

43
        return $this->state(fn (/** @scrutinizer ignore-unused */ array $attributes) => [

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
            'email_verified_at' => null,
45
        ]);
46
    }
47
}
48