Passed
Push — master ( b29bc1...457869 )
by Luiz Kim
02:18
created

Routes::setIcon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
6
use ApiPlatform\Metadata\Post;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Post 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 ApiPlatform\Metadata\GetCollection;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\GetCollection 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...
8
use ApiPlatform\Metadata\Delete;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Delete 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...
9
use ApiPlatform\Metadata\Put;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Put 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...
10
use ApiPlatform\Metadata\Get;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Get 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
use ApiPlatform\Metadata\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiResource 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...
12
use ApiPlatform\Metadata\ApiProperty;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiProperty 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...
13
use ApiPlatform\Metadata\ApiFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiFilter 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...
14
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Doctrine\Orm\Filter\SearchFilter 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...
15
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping 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...
16
use Doctrine\Common\Collections\ArrayCollection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection 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...
17
use Symfony\Component\Serializer\Annotation\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Annotation\Groups 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
use App\Filter\OrderEntityFilter;
0 ignored issues
show
Bug introduced by
The type App\Filter\OrderEntityFilter 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...
19
use ControleOnline\Entity\Order;
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\Order 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...
20
use stdClass;
21
22
23
/**
24
 * Routes
25
 *
26
 * @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class})
27
 * @ORM\Table(name="routes", uniqueConstraints={@ORM\UniqueConstraint(name="route", columns={"route"})}, indexes={@ORM\Index(name="module_id", columns={"module_id"})})
28
 * @ORM\Entity (repositoryClass="ControleOnline\Repository\RouteRepository")
29
 * @ORM\Entity
30
 */
31
32
#[ApiResource(
33
    operations: [
34
        new Get(security: 'is_granted(\'ROLE_ADMIN\') or (is_granted(\'ROLE_CLIENT\'))'),
35
        new Put(
36
            security: 'is_granted(\'ROLE_CLIENT\')',
37
            denormalizationContext: ['groups' => ['route_write']]
38
        ),
39
        new Delete(security: 'is_granted(\'ROLE_CLIENT\')'),
40
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')'),
41
        new Post(security: 'is_granted(\'ROLE_CLIENT\')'),
42
    ],
43
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
44
    normalizationContext: ['groups' => ['route_read']],
45
    denormalizationContext: ['groups' => ['route_write']]
46
)]
47
48
class Routes
49
{
50
    /**
51
     * @var int
52
     *
53
     * @ORM\Column(name="id", type="integer", nullable=false)
54
     * @ORM\Id
55
     * @ORM\GeneratedValue(strategy="IDENTITY")
56
     * @Groups({"menu_read","route_read"})   
57
     */
58
    private $id;
59
60
    /**
61
     * @var string
62
     *
63
     * @ORM\Column(name="route", type="string", length=50, nullable=false)
64
     * @Groups({"menu_read","route_read","route_write"})   
65
     */
66
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['route' => 'exact'])]
67
68
    private $route;
69
70
    /**
71
     * @var \Module
0 ignored issues
show
Bug introduced by
The type Module 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...
72
     *
73
     * @ORM\ManyToOne(targetEntity="Module")
74
     * @ORM\JoinColumns({
75
     *   @ORM\JoinColumn(name="module_id", referencedColumnName="id")
76
     * })
77
     * @Groups({"menu_read","route_read","route_write"})  
78
     */
79
    private $module;
80
    /**
81
     * @var string
82
     *
83
     * @ORM\Column(name="color", type="string", length=50, nullable=false, options={"default"="'$primary'"})
84
     * @Groups({"menu_read","route_read","route_write"})  
85
     */
86
    private $color = '$primary';
87
    /**
88
     * @var string
89
     *
90
     * @ORM\Column(name="icon", type="string", length=50, nullable=false)
91
     * @Groups({"menu_read","route_read","route_write"})  
92
     */
93
    private $icon;
94
95
    /**
96
     * Get the value of id
97
     */
98
    public function getId()
99
    {
100
        return $this->id;
101
    }
102
103
    /**
104
     * Set the value of id
105
     */
106
    public function setId(int $id): self
107
    {
108
        $this->id = $id;
109
110
        return $this;
111
    }
112
113
    /**
114
     * Get the value of route
115
     */
116
    public function getRoute()
117
    {
118
        return $this->route;
119
    }
120
121
    /**
122
     * Set the value of route
123
     */
124
    public function setRoute($route): self
125
    {
126
        $this->route = $route;
127
128
        return $this;
129
    }
130
131
    /**
132
     * Get the value of module
133
     */
134
    public function getModule()
135
    {
136
        return $this->module;
137
    }
138
139
    /**
140
     * Set the value of module
141
     */
142
    public function setModule($module): self
143
    {
144
        $this->module = $module;
145
146
        return $this;
147
    }
148
149
    /**
150
     * Get the value of color
151
     */
152
    public function getColor(): string
153
    {
154
        return $this->color;
155
    }
156
    /**
157
     * Set the value of color
158
     */
159
    public function setColor($color): self
160
    {
161
        $this->color = $color;
162
        return $this;
163
    }
164
    /**
165
     * Get the value of icon
166
     */
167
    public function getIcon(): string
168
    {
169
        return $this->icon;
170
    }
171
    /**
172
     * Set the value of icon
173
     */
174
    public function setIcon($icon): self
175
    {
176
        $this->icon = $icon;
177
        return $this;
178
    }
179
}
180