Completed
Push — master ( 8507e2...2d694e )
by Lars
01:39
created

InstanceCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 21 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arrayy\Type;
6
7
use Arrayy\ArrayyIterator;
8
use Arrayy\Collection\Collection;
9
10
final class InstanceCollection extends Collection implements \Arrayy\Type\TypeInterface
11
{
12
    /**
13
     * InstanceType constructor.
14
     *
15
     * @param array       $data
16
     * @param string|null $iteratorClass
17
     * @param bool|null   $checkPropertiesInConstructor
18
     * @param string      $className
19
     */
20 1
    public function __construct(
21
        $data = [],
22
        string $iteratorClass = null,
23
        bool $checkPropertiesInConstructor = null,
24
        string $className = ''
25
    ) {
26
        // fallback
27 1
        if ($iteratorClass === null) {
28 1
            $iteratorClass = ArrayyIterator::class;
29
        }
30 1
        if ($checkPropertiesInConstructor === null) {
31 1
            $checkPropertiesInConstructor = true;
32
        }
33
34 1
        parent::__construct(
35 1
            $data,
36 1
            $iteratorClass,
37 1
            $checkPropertiesInConstructor,
38 1
            self::convertIntoTypeCheckArray($className)
39
        );
40 1
    }
41
}
42