DocumentType   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 7
eloc 34
c 5
b 0
f 0
dl 0
loc 68
rs 10

7 Methods

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