Issues (121)

src/Model/Service/DefaultService.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Inspirum\Balikobot\Model\Service;
6
7
use Inspirum\Arrayable\BaseModel;
8
use Inspirum\Balikobot\Model\Country\CodCountry;
9
use function array_map;
10
11
/**
12
 * @extends \Inspirum\Arrayable\BaseModel<string,mixed>
13
 */
14
final class DefaultService extends BaseModel implements Service
15
{
16
    /**
17
     * @param list<string>|null $countries
0 ignored issues
show
The type Inspirum\Balikobot\Model\Service\list 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...
18
     * @param array<\Inspirum\Balikobot\Model\Country\CodCountry>|null $codCountries
19
     */
20 16
    public function __construct(
21
        private readonly string $type,
22
        private readonly ?string $name,
23
        private readonly ?ServiceOptionCollection $options = null,
24
        private readonly ?array $countries = null,
25
        private readonly ?array $codCountries = null,
26
    ) {
27 16
    }
28
29 4
    public function getType(): string
30
    {
31 4
        return $this->type;
32
    }
33
34 1
    public function getName(): ?string
35
    {
36 1
        return $this->name;
37
    }
38
39 3
    public function getOptions(): ?ServiceOptionCollection
40
    {
41 3
        return $this->options;
42
    }
43
44
    /** @inheritDoc */
45 2
    public function getCountries(): ?array
46
    {
47 2
        return $this->countries;
48
    }
49
50
    /** @inheritDoc */
51 2
    public function getCodCountries(): ?array
52
    {
53 2
        return $this->codCountries;
54
    }
55
56
    /** @inheritDoc */
57 2
    public function __toArray(): array
58
    {
59 2
        return [
60 2
            'type' => $this->type,
61 2
            'name' => $this->name,
62 2
            'options' => $this->options?->__toArray(),
63 2
            'countries' => $this->countries,
64 2
            'codCountries' => $this->codCountries !== null ? array_map(static fn (CodCountry $country): array => $country->__toArray(), $this->codCountries)
65
                : null,
66 2
        ];
67
    }
68
}
69