Total Complexity | 4 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | final class NamespaceName implements NameInterface |
||
8 | { |
||
9 | /** @var string */ |
||
10 | private $namespace; |
||
11 | |||
12 | public function __construct(string $namespace) |
||
13 | { |
||
14 | $this->namespace = $namespace; |
||
15 | } |
||
16 | |||
17 | public function getNamespaceName(): string |
||
18 | { |
||
19 | return $this->namespace; |
||
20 | } |
||
21 | |||
22 | public function getShortName(): string |
||
25 | } |
||
26 | |||
27 | public function getName(): string |
||
32 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: