Passed
Push — main ( ec0923...4d334c )
by Seth
01:22
created

FileFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A definition() 0 12 1
1
<?php
2
3
namespace SaasReady\Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Eloquent\Factories\Factory was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use SaasReady\Models\Currency;
0 ignored issues
show
Bug introduced by
The type SaasReady\Models\Currency was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use SaasReady\Models\File;
8
9
class FileFactory extends Factory
10
{
11
    protected $model = File::class;
12
13
    public function definition(): array
14
    {
15
        return [
16
            'model_id' => fn () => Currency::factory()->create(),
17
            'model_type' => Currency::class,
18
            'category' => $this->faker->creditCardType(),
19
            'filename' => $this->faker->userName() . $this->faker->fileExtension(),
20
            'original_filename' => $this->faker->userName() . $this->faker->fileExtension(),
21
            'size' => random_int(1000, 999999),
22
            'path' => $this->faker->filePath(),
23
            'mime_type' => $this->faker->mimeType(),
24
            'source' => 'test',
25
        ];
26
    }
27
}
28