Config::getConfigKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
use Symfony\Component\Serializer\Attribute\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Attribute\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...
6
7
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...
8
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...
9
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...
10
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...
11
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...
12
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...
13
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...
14
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...
15
use ControleOnline\Controller\AddAppConfigAction;
16
use ControleOnline\Controller\DiscoveryMainConfigsAction;
17
use ControleOnline\Listener\LogListener;
18
use ControleOnline\Repository\ConfigRepository;
19
use Doctrine\ORM\Mapping\Column;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\Column 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 Doctrine\ORM\Mapping\Entity;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\Entity 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 Doctrine\ORM\Mapping\EntityListeners;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\EntityListeners 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...
22
use Doctrine\ORM\Mapping\GeneratedValue;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\GeneratedValue 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 Doctrine\ORM\Mapping\Id;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\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...
24
use Doctrine\ORM\Mapping\JoinColumn;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\JoinColumn 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 Doctrine\ORM\Mapping\ManyToOne;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\ManyToOne 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 Doctrine\ORM\Mapping\Table;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\Table 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 Doctrine\ORM\Mapping\UniqueConstraint;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping\UniqueConstraint 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
#[ApiResource(
30
    operations: [
31
        new Get(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')'),
32
        new Delete(security: 'is_granted(\'ROLE_CLIENT\')'),
33
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')'),
34
        new Post(security: 'is_granted(\'ROLE_CLIENT\')'),
35
        new Post(
36
            security: 'is_granted(\'ROLE_CLIENT\')',
37
            uriTemplate: '/configs/add-configs',
38
            controller: AddAppConfigAction::class
39
        ),
40
        new Post(
41
            security: 'is_granted(\'ROLE_CLIENT\')',
42
            uriTemplate: '/configs/discovery-configs',
43
            controller: DiscoveryMainConfigsAction::class
44
        ),
45
        new Put(
46
            security: 'is_granted(\'ROLE_CLIENT\')',
47
            denormalizationContext: ['groups' => ['config:write']]
48
        ),
49
    ],
50
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
51
    normalizationContext: ['groups' => ['config:read']],
52
    denormalizationContext: ['groups' => ['config:write']]
53
)]
54
#[Table(name: 'config')]
55
#[UniqueConstraint(name: 'people_id', columns: ['people_id', 'configKey'])]
56
#[EntityListeners([LogListener::class])]
57
#[Entity(repositoryClass: ConfigRepository::class)]
58
class Config
59
{
60
    #[Groups(['config:read'])]
61
    #[Column(name: 'id', type: 'integer', nullable: false)]
62
    #[Id]
63
    #[GeneratedValue(strategy: 'IDENTITY')]
64
    private int $id = 0;
65
66
    #[Groups(['config:read', 'config:write'])]
67
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['people' => 'exact'])]
68
    #[JoinColumn(name: 'people_id', referencedColumnName: 'id')]
69
    #[ManyToOne(targetEntity: People::class)]
70
    private ?People $people = null;
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\People 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
72
    #[Groups(['config:read', 'config:write'])]
73
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['configKey' => 'exact'])]
74
    #[Column(name: 'config_key', type: 'string', length: 255, nullable: false)]
75
    private string $configKey;
76
77
    #[Groups(['config:read', 'config:write'])]
78
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['visibility' => 'exact'])]
79
    #[Column(name: 'visibility', type: 'string', length: 255, nullable: false)]
80
    private string $visibility;
81
82
    #[Groups(['config:read', 'config:write'])]
83
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['configValue' => 'exact'])]
84
    #[Column(name: 'config_value', type: 'string', length: 255, nullable: false)]
85
    private string $configValue;
86
87
    #[Groups(['config:read', 'config:write'])]
88
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['module' => 'exact'])]
89
    #[JoinColumn(name: 'module_id', referencedColumnName: 'id')]
90
    #[ManyToOne(targetEntity: Module::class)]
91
    private ?Module $module = null;
92
93
    public function getId(): int
94
    {
95
        return $this->id;
96
    }
97
98
    public function setPeople(?People $people): self
99
    {
100
        $this->people = $people;
101
        return $this;
102
    }
103
104
    public function getPeople(): ?People
105
    {
106
        return $this->people;
107
    }
108
109
    public function setConfigKey(string $configKey): self
110
    {
111
        $this->configKey = $configKey;
112
        return $this;
113
    }
114
115
    public function getConfigKey(): string
116
    {
117
        return $this->configKey;
118
    }
119
120
    public function setVisibility(string $visibility): self
121
    {
122
        $this->visibility = $visibility;
123
        return $this;
124
    }
125
126
    public function getVisibility(): string
127
    {
128
        return $this->visibility;
129
    }
130
131
    public function setConfigValue(string $configValue): self
132
    {
133
        $this->configValue = $configValue;
134
        return $this;
135
    }
136
137
    public function getConfigValue(): string
138
    {
139
        return $this->configValue;
140
    }
141
142
    public function getModule(): ?Module
143
    {
144
        return $this->module;
145
    }
146
147
    public function setModule(?Module $module): self
148
    {
149
        $this->module = $module;
150
        return $this;
151
    }
152
}