Collection::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
namespace MusicBrainz;
4
5
/**
6
 * Represents a MusicBrainz collection object
7
 * @package MusicBrainz
8
 */
9
class Collection
10
{
11
    /**
12
     * @var string
13
     */
14
    public $id;
15
    /**
16
     * @var array
17
     */
18
    private $data;
19
    /**
20
     * @var MusicBrainz
21
     */
22
    private $brainz;
23
24
    /**
25
     * @param array       $collection
26
     * @param MusicBrainz $brainz
27
     */
28 View Code Duplication
    public function __construct(array $collection, MusicBrainz $brainz)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    {
30
        $this->data   = $collection;
31
        $this->brainz = $brainz;
32
33
        $this->id = isset($collection['id']) ? (string)$collection['id'] : '';
34
    }
35
}
36