Test Failed
Push — master ( 65b1e6...cf15ae )
by Stephen
02:23
created

AddressFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A definition() 0 11 1
1
<?php
2
3
namespace Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
6
use Sfneal\Address\Models\Address;
7
use Sfneal\Address\Tests\Models\People;
8
9
class AddressFactory extends Factory
10
{
11
    /**
12
     * The name of the factory's corresponding model.
13
     *
14
     * @var string
15
     */
16
    protected $model = Address::class;
17
18
    /**
19
     * Define the model's default state.
20
     *
21
     * @return array
22
     */
23
    public function definition(): array
24
    {
25
        return [
26
            'type' => $this->faker->randomElement(['home', 'work', 'business']),
27
            'address_1' => $this->faker->streetAddress,
28
            'address_2' => $this->faker->secondaryAddress,
29
            'city' => $this->faker->city,
30
            'state' => $this->faker->state,
31
            'zip' => $this->faker->postcode,
32
            'addressable_id' => People::factory(),
33
            'addressable_type' => People::class,
34
        ];
35
    }
36
}
37