Dump::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 8
dl 0
loc 8
rs 10
c 0
b 0
f 0

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
namespace AL\Common\Model\Dump;
3
4
/**
5
 * Maps to the `Dump` table
6
 */
7
class Dump {
8
    private $id;
9
    private $media_id;
10
    private $format;
11
    private $sha512;
12
    private $date;
13
    private $size;
14
    private $info;
15
    private $user;
16
17
    public function __construct($id, $media_id, $format, $sha512, $date, $size, $info, $user) {
0 ignored issues
show
Unused Code introduced by
The parameter $media_id is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    public function __construct($id, /** @scrutinizer ignore-unused */ $media_id, $format, $sha512, $date, $size, $info, $user) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
        $this->id = $id;
19
        $this->format = $format;
20
        $this->sha512 = $sha512;
21
        $this->date = $date;
22
        $this->size = $size;
23
        $this->info = $info;
24
        $this->user = $user;
25
    }
26
27
    public function getId() {
28
        return $this->id;
29
    }
30
31
    public function getMediaId() {
32
        return $this->media_id;
33
    }
34
35
    public function getFormat() {
36
        return $this->format;
37
    }
38
39
    public function getSha512() {
40
        return $this->sha512;
41
    }
42
43
    public function getDate() {
44
        return $this->date;
45
    }
46
47
    public function getSize() {
48
        return $this->size;
49
    }
50
51
    public function getInfo() {
52
        return $this->info;
53
    }
54
    
55
    public function getUser() {
56
        return $this->user;
57
    }
58
}
59