Passed
Push — master ( ba7d8d...e67af9 )
by Luiz Kim
02:11
created

Cep::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
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 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...
6
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...
7
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...
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 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...
10
use DoctrineExtensions\Query\Mysql\Lpad;
0 ignored issues
show
Bug introduced by
The type DoctrineExtensions\Query\Mysql\Lpad 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 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...
12
/**
13
 * Cep
14
 *
15
 * @ORM\EntityListeners ({App\Listener\LogListener::class})
16
 * @ORM\Table (name="cep", uniqueConstraints={@ORM\UniqueConstraint (name="CEP", columns={"cep"})})
17
 * @ORM\Entity (repositoryClass="ControleOnline\Repository\CepRepository")
18
 */
19
#[ApiResource(operations: [new Get(security: 'is_granted(\'ROLE_CLIENT\')')], formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], normalizationContext: ['groups' => ['cep_read']], denormalizationContext: ['groups' => ['cep_write']])]
20
class Cep
21
{
22
    /**
23
     * @var integer
24
     *
25
     * @ORM\Column(name="id", type="integer", nullable=false)
26
     * @ORM\Id
27
     * @ORM\GeneratedValue(strategy="IDENTITY")
28
     */
29
    private $id;
30
    /**
31
     * @var integer
32
     *
33
     * @ORM\Column(name="cep", type="integer", nullable=false)
34
     * @Groups({"people_read", "address_read"})
35
     */
36
    private $cep;
37
    /**
38
     * @var \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...
39
     *
40
     * @ORM\OneToMany(targetEntity="ControleOnline\Entity\Street", mappedBy="cep")
41
     */
42
    private $street;
43
    /**
44
     * Constructor
45
     */
46
    public function __construct()
47
    {
48
        $this->street = new \Doctrine\Common\Collections\ArrayCollection();
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection 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...
49
    }
50
    /**
51
     * Get id
52
     *
53
     * @return integer
54
     */
55
    public function getId()
56
    {
57
        return $this->id;
58
    }
59
    /**
60
     * Set cep
61
     *
62
     * @param integer $cep
63
     * @return Cep
64
     */
65
    public function setCep($cep)
66
    {
67
        $this->cep = $cep;
68
        return $this;
69
    }
70
    /**
71
     * Get cep
72
     *
73
     * @return integer
74
     */
75
    public function getCep()
76
    {
77
        return STR_PAD($this->cep, 8, "0", STR_PAD_LEFT);
0 ignored issues
show
Bug Best Practice introduced by
The expression return STR_PAD($this->ce...ne\Entity\STR_PAD_LEFT) returns the type string which is incompatible with the documented return type integer.
Loading history...
78
    }
79
    /**
80
     * Add street
81
     *
82
     * @param \ControleOnline\Entity\Street $street
83
     * @return Cep
84
     */
85
    public function addStreet(\ControleOnline\Entity\Street $street)
86
    {
87
        $this->street[] = $street;
88
        return $this;
89
    }
90
    /**
91
     * Remove street
92
     *
93
     * @param \ControleOnline\Entity\Street $street
94
     */
95
    public function removeStreet(\ControleOnline\Entity\Street $street)
96
    {
97
        $this->street->removeElement($street);
98
    }
99
    /**
100
     * Get street
101
     *
102
     * @return \Doctrine\Common\Collections\Collection
103
     */
104
    public function getStreet()
105
    {
106
        return $this->street;
107
    }
108
}
109