Completed
Push — master ( 97a535...5d395b )
by Carlos C
14:54 queued 02:21
created

Collection::comparisonMethodIsIdentical()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php namespace GenericCollections;
2
3
use GenericCollections\Abstracts\AbstractCollection;
4
use GenericCollections\Traits\ElementTypeProperty;
5
use GenericCollections\Traits\OptionsProperty;
6
use GenericCollections\Utils\TypeProperty;
7
8
/**
9
 * Generic collection implementation
10
 *
11
 * Options:
12
 * - Defaults: not allow nulls, allow duplicates, identical comparisons
13
 *
14
 * @package GenericCollections
15
 */
16 View Code Duplication
class Collection extends AbstractCollection
0 ignored issues
show
Duplication introduced by
This class 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...
17
{
18
    use ElementTypeProperty;
19
    use OptionsProperty;
20
21
    /**
22
     * @param string $elementType
23
     * @param array $elements
24
     * @param int $options
25
     */
26 93
    public function __construct($elementType, array $elements = [], $options = 0)
27
    {
28 93
        $this->options = new Options($options);
29 93
        $this->elementType = new TypeProperty($elementType, $this->options->optionAllowNullMembers());
30 93
        $this->addAll($elements);
31 93
    }
32
}
33