Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | protected function createLocatedSource(Identifier $identifier) : ?LocatedSource |
||
22 | { |
||
23 | if (! $identifier->isClass()) { |
||
24 | return null; |
||
25 | } |
||
26 | |||
27 | if ($identifier->getName() === Identifier::WILDCARD) { |
||
28 | return null; |
||
29 | } |
||
30 | |||
31 | $fqcn = $identifier->getName(); |
||
32 | $classNameParts = explode('\\', $fqcn); |
||
33 | $shortName = array_slice($classNameParts, -1)[0]; |
||
34 | $namespaceName = implode('\\', array_slice($classNameParts, 0, count($classNameParts) - 1)); |
||
35 | |||
36 | return new LocatedSource( |
||
37 | sprintf('<?php namespace %s{interface %s {}}', $namespaceName, $shortName), |
||
38 | null |
||
39 | ); |
||
42 |