Issues (238)

src/Entities/LocaleEntity.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Translation\Entities;
4
5
use Translation\Models\Locale;
6
7
class LocaleEntity extends AbstractEntity
8
{
9
    protected $model = Locale::class;
10
11
    private $code;
12
    private $name;
13
    private $icon;
14
15
    /**
16
     * LocaleEntity constructor.
17
     *
18
     * @param array $attributes
19
     */
20
    public function __construct(array $attributes = [])
21
    {
22
        if (isset($attributes['code']) && !is_null($attributes['code'])) {
23
            $this->setCode($attributes['code']);
24
        }
25
        if (isset($attributes['name']) && !is_null($attributes['name'])) {
26
            $this->setName($attributes['name']);
27
        }
28
        if (isset($attributes['icon']) && !is_null($attributes['icon'])) {
29
            $this->setIcon($attributes['icon']);
30
        }
31
    }
32
33
    /**
34
     * @param  int $code
35
     * @return $this
36
     */
37
    private function setCode(int $code): LocaleEntity
38
    {
39
        $this->code = $code;
40
41
        return $this;
42
    }
43
44
    /**
45
     * @return int
46
     */
47
    public function getCode(): int
48
    {
49
        return $this->code;
50
    }
51
    public function getName(): string
52
    {
53
        return $this->name;
54
    }
55
    public function setName($value): vocode
0 ignored issues
show
The type Translation\Entities\vocode 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...
56
    {
57
        $this->name = $value;
58
    }
59
    public function getIcon(): string
60
    {
61
        return $this->icon;
62
    }
63
    public function setIcon($value): vocode
64
    {
65
        $this->icon = $value;
66
    }
67
    /**
68
     * @inheritdoc
69
     */
70
    public function __toString(): string
71
    {
72
        return $this->getName();
73
    }
74
75
    /**
76
     * @inheritdoc
77
     */
78
    public function toArray(): array
79
    {
80
        return [
81
            'code' => $this->getCode(),
82
            'name' => $this->getName(),
83
        ];
84
    }
85
}
86