Passed
Push — master ( 34f799...3d8860 )
by Luiz Kim
16:42 queued 08:38
created

ContractModel   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 110
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 25
c 2
b 0
f 0
dl 0
loc 110
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setFile() 0 5 1
A setPeople() 0 5 1
A getPeople() 0 3 1
A __construct() 0 1 1
A setCategory() 0 5 1
A getId() 0 3 1
A getFile() 0 3 1
A getCategory() 0 3 1
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
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...
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\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...
8
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...
9
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...
10
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...
11
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...
12
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...
13
use DateTime;
14
use Doctrine\Common\Collections\Collection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\Collection 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 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...
17
18
/**
19
 * @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class})
20
 * @ORM\Entity (repositoryClass="ControleOnline\Repository\ContractModelRepository")
21
 */
22
#[ApiResource(
23
    operations: [
24
        new Get(security: 'is_granted(\'ROLE_CLIENT\')'),
25
        new Put(),
26
        new Post(),
27
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')')
28
    ],
29
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
30
    normalizationContext: ['groups' => ['contract_model_read']],
31
    denormalizationContext: ['groups' => ['contract_model_write']]
32
)]
33
class ContractModel
34
{
35
    /**
36
     * @ORM\Column(type="integer", nullable=false)
37
     * @ORM\Id
38
     * @ORM\GeneratedValue(strategy="IDENTITY")
39
     * @Groups({ "contract_read"})
40
     */
41
    private $id;
42
43
    /**
44
     * @var \ControleOnline\Entity\Category
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\Category 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...
45
     *
46
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Category")
47
     * @ORM\JoinColumns({
48
     *   @ORM\JoinColumn(name="category_id", referencedColumnName="id")
49
     * })
50
     * @Groups({"contract_read"})
51
     */
52
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['category' => 'exact'])]
53
54
    private $category;
55
    /**
56
     * @var \ControleOnline\Entity\People
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...
57
     *
58
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People")
59
     * @ORM\JoinColumns({
60
     *   @ORM\JoinColumn(name="people_id", referencedColumnName="id")
61
     * })
62
     * @Groups({"contract_read"})
63
     */
64
    private $people;
65
    /**
66
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File")
67
     * @ORM\JoinColumns({
68
     *   @ORM\JoinColumn(referencedColumnName="id", nullable=false)
69
     * })
70
     * @Groups({"contract_read"})
71
     */
72
    private $file;
73
74
    public function __construct() {}
75
    public function getId(): int
76
    {
77
        return $this->id;
78
    }
79
80
    /**
81
     * Get })
82
     */
83
    public function getFile()
84
    {
85
        return $this->file;
86
    }
87
88
    /**
89
     * Set })
90
     */
91
    public function setFile($file): self
92
    {
93
        $this->file = $file;
94
95
        return $this;
96
    }
97
98
    /**
99
     * Get the value of people
100
     */
101
    public function getPeople(): \ControleOnline\Entity\People
102
    {
103
        return $this->people;
104
    }
105
106
    /**
107
     * Set the value of people
108
     */
109
    public function setPeople(\ControleOnline\Entity\People $people): self
110
    {
111
        $this->people = $people;
112
113
        return $this;
114
    }
115
116
    /**
117
     * Get the value of category
118
     */
119
    public function getCategory()
120
    {
121
        return $this->category;
122
    }
123
124
    /**
125
     * Set the value of category
126
     */
127
    public function setCategory($category): self
128
    {
129
        $this->category = $category;
130
131
        return $this;
132
    }
133
}
134