DocumentType   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 29
c 3
b 0
f 0
dl 0
loc 53
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getPeopleType() 0 3 1
A setPeopleType() 0 4 1
A setDocumentType() 0 4 1
A getDocumentType() 0 3 1
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\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\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...
12
use ControleOnline\Listener\LogListener;
0 ignored issues
show
Bug introduced by
The type ControleOnline\Listener\LogListener 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 ControleOnline\Repository\DocumentTypeRepository;
14
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...
15
16
#[ApiResource(
17
    operations: [
18
        new Get(security: 'is_granted(\'ROLE_CLIENT\')'),
19
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')')
20
    ],
21
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
22
    normalizationContext: ['groups' => ['document_type:read']],
23
    denormalizationContext: ['groups' => ['document_type:write']]
24
)]
25
#[ApiFilter(filterClass: SearchFilter::class, properties: ['peopleType' => 'exact'])]
26
#[ORM\Table(name: 'document_type')]
27
#[ORM\EntityListeners([LogListener::class])]
28
#[ORM\Entity(repositoryClass: DocumentTypeRepository::class)]
29
class DocumentType
30
{
31
    #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
32
    #[ORM\Id]
33
    #[ORM\GeneratedValue(strategy: 'IDENTITY')]
34
    private int $id = 0;
35
36
    #[ORM\Column(name: 'document_type', type: 'string', length: 50, nullable: false)]
37
    #[Groups(['people:read', 'document:read', 'document_type:read', 'carrier:read'])]
38
    private string $documentType;
39
40
    #[ORM\Column(name: 'people_type', type: 'string', length: 1, nullable: false)]
41
    #[Groups(['people:read', 'document:read', 'document_type:read'])]
42
    private string $peopleType;
43
44
    public function getId(): int
45
    {
46
        return $this->id;
47
    }
48
49
    public function setDocumentType(string $documentType): self
50
    {
51
        $this->documentType = $documentType;
52
        return $this;
53
    }
54
55
    public function getDocumentType(): string
56
    {
57
        return $this->documentType;
58
    }
59
60
    public function setPeopleType(string $peopleType): self
61
    {
62
        $this->peopleType = $peopleType;
63
        return $this;
64
    }
65
66
    public function getPeopleType(): string
67
    {
68
        return $this->peopleType;
69
    }
70
}