Role   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 142
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 142
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
namespace App\Entity;
4
5
use App\Entity\Attribute\Accessor as EntityAccessor;
6
use Ds\Component\Locale\Model\Type\Localizable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Locale\Model\Type\Localizable 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 Ds\Component\Model\Attribute\Accessor;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor 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 Ds\Component\Model\Type\Identifiable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Identifiable 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 Ds\Component\Model\Type\Ownable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Ownable 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 Ds\Component\Model\Type\Sluggable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Sluggable 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 Ds\Component\Model\Type\Uuidentifiable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Uuidentifiable 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 Ds\Component\Model\Type\Versionable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Type\Versionable 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 Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Tenant\Model\Attribute\Accessor 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 Ds\Component\Tenant\Model\Type\Tenantable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Tenant\Model\Type\Tenantable 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 Ds\Component\Translation\Model\Attribute\Accessor as TranslationAccessor;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation\Model\Attribute\Accessor 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 Ds\Component\Translation\Model\Type\Translatable;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation\Model\Type\Translatable 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 Knp\DoctrineBehaviors\Model as Behavior;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Model 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
19
use ApiPlatform\Core\Annotation\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\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...
20
use ApiPlatform\Core\Annotation\ApiProperty;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\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...
21
use App\Validator\Constraints\Role as RoleAssert;
22
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...
23
use Ds\Component\Locale\Model\Annotation\Locale;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Locale\Model\Annotation\Locale 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...
24
use Ds\Component\Translation\Model\Annotation\Translate;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...el\Annotation\Translate 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...
25
use Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert;
0 ignored issues
show
Bug introduced by
The type Symfony\Bridge\Doctrine\Validator\Constraints 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...
26
use Symfony\Component\Serializer\Annotation As Serializer;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Annotation 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...
27
use Symfony\Component\Validator\Constraints as Assert;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Validator\Constraints 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...
28
29
/**
30
 * Class Role
31
 *
32
 * @ApiResource(
33
 *      attributes={
34
 *          "normalization_context"={
35
 *              "groups"={"role_output"}
36
 *          },
37
 *          "denormalization_context"={
38
 *              "groups"={"role_input"}
39
 *          },
40
 *          "filters"={
41
 *              "app.role.search",
42
 *              "app.role.search_translation",
43
 *              "app.role.date",
44
 *              "app.role.order"
45
 *          }
46
 *      }
47
 * )
48
 * @ORM\Entity(repositoryClass="App\Repository\RoleRepository")
49
 * @ORM\Table(
50
 *     name="app_role",
51
 *     uniqueConstraints={
52
 *         @ORM\UniqueConstraint(columns={"slug", "tenant"})
53
 *     }
54
 * )
55
 * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
56
 * @ORMAssert\UniqueEntity(fields="uuid")
57
 * @ORMAssert\UniqueEntity(fields={"slug", "tenant"})
58
 * @RoleAssert\Permissions\Valid
59
 */
60
class Role implements Identifiable, Uuidentifiable, Sluggable, Ownable, Translatable, Localizable, Versionable, Tenantable
61
{
62
    use Behavior\Translatable\Translatable;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Mo...anslatable\Translatable 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...
63
    use Behavior\Timestampable\Timestampable;
0 ignored issues
show
Bug introduced by
The type Knp\DoctrineBehaviors\Mo...stampable\Timestampable 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...
64
65
    use Accessor\Id;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Id 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...
66
    use Accessor\Uuid;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Uuid 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...
67
    use Accessor\Owner;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Owner 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...
68
    use Accessor\OwnerUuid;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\OwnerUuid 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...
69
    use TranslationAccessor\Title;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Translation...ttribute\Accessor\Title 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...
70
    use Accessor\Slug;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Slug 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...
71
    use Accessor\Data;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Data 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
    use EntityAccessor\Permissions;
73
    use Accessor\Deleted;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Deleted 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...
74
    use Accessor\Version;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Model\Attribute\Accessor\Version 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...
75
    use TenantAccessor\Tenant;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Tenant\Mode...tribute\Accessor\Tenant 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...
76
77
    /**
78
     * @var integer
79
     * @ApiProperty(identifier=false, writable=false)
80
     * @Serializer\Groups({"role_output"})
81
     * @ORM\Id
82
     * @ORM\GeneratedValue(strategy="AUTO")
83
     * @ORM\Column(name="id", type="integer")
84
     */
85
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
86
87
    /**
88
     * @var string
89
     * @ApiProperty(identifier=true, writable=false)
90
     * @Serializer\Groups({"role_output"})
91
     * @ORM\Column(name="uuid", type="guid", unique=true)
92
     * @Assert\Uuid
93
     */
94
    private $uuid;
0 ignored issues
show
introduced by
The private property $uuid is not used, and could be removed.
Loading history...
95
96
    /**
97
     * @var \DateTime
98
     * @ApiProperty(writable=false)
99
     * @Serializer\Groups({"role_output"})
100
     */
101
    protected $createdAt;
102
103
    /**
104
     * @var \DateTime
105
     * @ApiProperty(writable=false)
106
     * @Serializer\Groups({"role_output"})
107
     */
108
    protected $updatedAt;
109
110
    /**
111
     * @var string
112
     * @ApiProperty
113
     * @Serializer\Groups({"role_output", "role_input"})
114
     * @ORM\Column(name="`owner`", type="string", length=255, nullable=true)
115
     * @Assert\NotBlank
116
     * @Assert\Length(min=1, max=255)
117
     */
118
    private $owner;
0 ignored issues
show
introduced by
The private property $owner is not used, and could be removed.
Loading history...
119
120
    /**
121
     * @var string
122
     * @ApiProperty
123
     * @Serializer\Groups({"role_output", "role_input"})
124
     * @ORM\Column(name="owner_uuid", type="guid", nullable=true)
125
     * @Assert\NotBlank
126
     * @Assert\Uuid
127
     */
128
    private $ownerUuid;
0 ignored issues
show
introduced by
The private property $ownerUuid is not used, and could be removed.
Loading history...
129
130
    /**
131
     * @var array
132
     * @ApiProperty
133
     * @Serializer\Groups({"role_output", "role_input"})
134
     * @Assert\Type("array")
135
     * @Assert\NotBlank
136
     * @Assert\All({
137
     *     @Assert\NotBlank,
138
     *     @Assert\Length(min=1)
139
     * })
140
     * @Locale
141
     * @Translate
142
     */
143
    private $title;
144
145
    /**
146
     * @var string
147
     * @ApiProperty
148
     * @Serializer\Groups({"role_output", "role_input"})
149
     * @ORM\Column(name="slug", type="string")
150
     * @Assert\NotBlank
151
     * @Assert\Length(min=1, max=255)
152
     */
153
    private $slug;
0 ignored issues
show
introduced by
The private property $slug is not used, and could be removed.
Loading history...
154
155
    /**
156
     * @var array
157
     * @ApiProperty
158
     * @Serializer\Groups({"role_output", "role_input"})
159
     * @ORM\Column(name="data", type="json_array", options={"default":"[]"})
160
     * @Assert\Type("array")
161
     */
162
    protected $data;
163
164
    /**
165
     * @var array
166
     * @ApiProperty
167
     * @Serializer\Groups({"role_output", "role_input"})
168
     * @ORM\Column(name="permissions", type="json_array")
169
     * @Assert\Type("array")
170
     */
171
    private $permissions;
172
173
    /**
174
     * @var integer
175
     * @ApiProperty
176
     * @Serializer\Groups({"role_output", "role_input"})
177
     * @ORM\Column(name="version", type="integer")
178
     * @ORM\Version
179
     * @Assert\NotBlank
180
     * @Assert\Type("integer")
181
     */
182
    private $version;
183
184
    /**
185
     * @var string
186
     * @ApiProperty(writable=false)
187
     * @Serializer\Groups({"role_output"})
188
     * @ORM\Column(name="tenant", type="guid")
189
     * @Assert\Uuid
190
     */
191
    private $tenant;
0 ignored issues
show
introduced by
The private property $tenant is not used, and could be removed.
Loading history...
192
193
    /**
194
     * Constructor
195
     */
196
    public function __construct()
197
    {
198
        $this->title = [];
199
        $this->data = [];
200
        $this->permissions = [];
201
        $this->version = 1;
202
    }
203
}
204