Passed
Push — develop ( 6aee1f...eb8792 )
by Laurent
01:33
created

Company::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
c 1
b 0
f 0
nc 1
nop 12
dl 0
loc 26
rs 9.8666

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\Application\Company\ReadModel;
15
16
class Company
17
{
18
    public string $uuid;
19
    public string $name;
20
    public string $address;
21
    public string $zipCode;
22
    public string $town;
23
    public string $country;
24
    public string $phone;
25
    public string $facsimile;
26
    public string $email;
27
    public string $contact;
28
    public string $cellphone;
29
    public string $slug;
30
31
    public function __construct(
32
        string $uuid,
33
        string $name,
34
        string $address,
35
        string $zipCode,
36
        string $town,
37
        string $country,
38
        string $phone,
39
        string $facsimile,
40
        string $email,
41
        string $contact,
42
        string $cellphone,
43
        string $slug
44
    ) {
45
        $this->uuid = $uuid;
46
        $this->name = $name;
47
        $this->address = $address;
48
        $this->zipCode = $zipCode;
49
        $this->town = $town;
50
        $this->country = $country;
51
        $this->phone = $phone;
52
        $this->facsimile = $facsimile;
53
        $this->email = $email;
54
        $this->contact = $contact;
55
        $this->cellphone = $cellphone;
56
        $this->slug = $slug;
57
    }
58
}
59