Completed
Push — master ( 32f082...893399 )
by Dmitry
12:23
created

Collection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace hiapi\endpoints\Module\InOutControl\VO;
4
5
use hiapi\commands\BaseCommand;
6
7
/**
8
 * Class Collection
9
 *
10
 * @author Dmytro Naumenko <[email protected]>
11
 *
12
 * @template-covariant T of \hiapi\commands\BaseCommand
13
 * @psalm-immutable
14
 */
15
class Collection
16
{
17
    /**
18
     * @psalm-var class-string<T>
19
     */
20
    private string $entriesClass;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
21
22
    /**
23
     * @psalm-param class-string $entriesClass
24
     */
25
    private function __construct(string $entriesClass)
26
    {
27
        $this->entriesClass = $entriesClass;
28
    }
29
30
    /**
31
     * @psalm-return class-string<T>
32
     */
33
    public function getEntriesClass(): string
34
    {
35
        return $this->entriesClass;
36
    }
37
38
    /**
39
     * @psalm-param class-string $className
40
     */
41
    public static function of(string $className): self
42
    {
43
        return new self($className);
44
    }
45
}
46