Passed
Push — master ( b0a0df...28fb83 )
by Andrey
01:08 queued 15s
created

File   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\GraphQL\Type;
6
7
use Andi\GraphQL\Definition\Field\TypeAwareInterface;
8
use Andi\GraphQL\Type\AbstractObjectType;
9
use GraphQL\Type\Definition as Webonyx;
10
use Nyholm\Psr7\UploadedFile;
0 ignored issues
show
Bug introduced by
The type Nyholm\Psr7\UploadedFile 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...
11
12
final class File extends AbstractObjectType
13
{
14
    protected string $name = 'File';
15
16
    public function __construct()
17
    {
18
        $this->fields = [
19
            'size' => [
20
                'type' => Webonyx\IntType::class,
21
                'mode' => TypeAwareInterface::IS_REQUIRED,
22
                'resolve' => static fn (UploadedFile $file): int => $file->getSize(),
23
            ],
24
            'filename' => [
25
                'type' => Webonyx\StringType::class,
26
                'mode' => TypeAwareInterface::IS_REQUIRED,
27
                'resolve' => static fn (UploadedFile $file): string => $file->getClientFilename(),
28
            ],
29
            'mediaType' => [
30
                'type' => Webonyx\StringType::class,
31
                'mode' => TypeAwareInterface::IS_REQUIRED,
32
                'resolve' => static fn (UploadedFile $file): string => $file->getClientMediaType(),
33
            ],
34
        ];
35
    }
36
}
37