Passed
Push — master ( af7a0d...c293f7 )
by Julien
01:06 queued 11s
created

CollectionType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Mapado\RestClientSdk\PHPStan\Type;
6
7
use PHPStan\Type\IntersectionType;
8
use PHPStan\Type\IterableType;
9
use PHPStan\Type\MixedType;
10
use PHPStan\Type\ObjectType;
11
use PHPStan\Type\Type;
12
13
class CollectionType extends IntersectionType
14
{
15
    /** @var ObjectType */
16
    private $keyType;
17
18
    public function __construct(Type $itemType)
19
    {
20
        $this->keyType = new ObjectType('Mapado\RestClientSdk\Collection\Collection');
21
22
        parent::__construct([
23
            $this->keyType,
24
            new IterableType(new MixedType(), $itemType),
25
        ]);
26
    }
27
}
28