UserFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
dl 0
loc 27
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A unverified() 0 4 1
A definition() 0 8 1
1
<?php
2
3
namespace Usamamuneerchaudhary\Commentify\Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
6
use Illuminate\Support\Str;
7
use Usamamuneerchaudhary\Commentify\Models\User;
8
9
/**
10
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
11
 */
12
class UserFactory extends Factory
13
{
14
    protected $model = User::class;
15
16
    /**
17
     * Define the model's default state.
18
     *
19
     * @return array<string, mixed>
20
     */
21
    public function definition(): array
22
    {
23
        return [
24
            'name' => fake()->name(),
25
            'email' => fake()->unique()->safeEmail(),
26
            'email_verified_at' => now(),
27
            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
28
            'remember_token' => Str::random(10),
29
        ];
30
    }
31
32
    /**
33
     * Indicate that the model's email address should be unverified.
34
     */
35
    public function unverified(): static
36
    {
37
        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

37
        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...
38
            'email_verified_at' => null,
39
        ]);
40
    }
41
}
42