Passed
Pull Request — develop (#166)
by Laurent
01:46
created

Supplier::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 36
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 17
c 1
b 0
f 0
nc 1
nop 16
dl 0
loc 36
rs 9.7

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Administration\Infrastructure\Persistence\DoctrineOrm\Entities;
15
16
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...
17
18
/**
19
 * @ORM\Table(name="supplier")
20
 * @ORM\Entity(repositoryClass="Administration\Infrastructure\Persistence\DoctrineOrm\Repositories\DoctrineSupplierRepository")
21
 */
22
class Supplier extends Contact
23
{
24
    /**
25
     * @ORM\Column(type="string", nullable=false)
26
     */
27
    private string $familyLog;
28
29
    /**
30
     * @ORM\Column(type="integer", nullable=false)
31
     */
32
    private int $delayDelivery;
33
34
    /**
35
     * @ORM\Column(type="array", nullable=false)
36
     */
37
    private array $orderDays;
38
39
    /**
40
     * @ORM\Column(type="boolean", nullable=false)
41
     */
42
    private bool $active;
43
44
    public function __construct(
45
        string $uuid,
46
        string $name,
47
        string $address,
48
        string $zipCode,
49
        string $town,
50
        string $country,
51
        string $phone,
52
        string $facsimile,
53
        string $email,
54
        string $contact,
55
        string $cellphone,
56
        string $slug,
57
        string $familyLog,
58
        int $delayDelivery,
59
        array $orderDays,
60
        bool $active
61
    ) {
62
        parent::__construct(
63
            $uuid,
64
            $name,
65
            $address,
66
            $zipCode,
67
            $town,
68
            $country,
69
            $phone,
70
            $facsimile,
71
            $email,
72
            $contact,
73
            $cellphone,
74
            $slug
75
        );
76
        $this->familyLog = $familyLog;
77
        $this->delayDelivery = $delayDelivery;
78
        $this->orderDays = $orderDays;
79
        $this->active = $active;
80
    }
81
82
    public function getFamilyLog(): string
83
    {
84
        return $this->familyLog;
85
    }
86
87
    public function setFamilyLog(string $familyLog): self
88
    {
89
        $this->familyLog = $familyLog;
90
91
        return $this;
92
    }
93
94
    public function getDelayDelivery(): int
95
    {
96
        return $this->delayDelivery;
97
    }
98
99
    public function setDelayDelivery(int $delayDelivery): self
100
    {
101
        $this->delayDelivery = $delayDelivery;
102
103
        return $this;
104
    }
105
106
    public function getOrderDays(): array
107
    {
108
        return $this->orderDays;
109
    }
110
111
    public function setOrderDays(array $orderDays): self
112
    {
113
        $this->orderDays = $orderDays;
114
115
        return $this;
116
    }
117
118
    public function isActive(): bool
119
    {
120
        return $this->active;
121
    }
122
123
    public function setActive(bool $active): self
124
    {
125
        $this->active = $active;
126
127
        return $this;
128
    }
129
}
130