We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 6 |
Paths | 6 |
Total Lines | 27 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6.0106 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 33 | private function getType($alias) |
|
37 | { |
||
38 | 33 | if (!is_string($alias)) { |
|
39 | 25 | return $alias; |
|
40 | } |
||
41 | // Non-Null |
||
42 | 33 | if ('!' === $alias[strlen($alias) - 1]) { |
|
43 | 13 | return Type::nonNull($this->getType(substr($alias, 0, -1))); |
|
44 | } |
||
45 | // List |
||
46 | 33 | if ('[' === $alias[0]) { |
|
47 | 7 | if (']' !== $alias[strlen($alias) - 1]) { |
|
48 | throw new UnresolvableException(sprintf('Invalid type "%s"', $alias)); |
||
49 | } |
||
50 | |||
51 | 7 | return Type::listOf($this->getType(substr($alias, 1, -1))); |
|
52 | } |
||
53 | |||
54 | 33 | $type = $this->getSolution($alias); |
|
55 | 33 | if (null === $type) { |
|
56 | 1 | throw new UnresolvableException( |
|
57 | 1 | sprintf('Unknown type with alias "%s" (verified service tag)', $alias) |
|
58 | 1 | ); |
|
59 | } |
||
60 | |||
61 | 32 | return $type; |
|
62 | } |
||
63 | |||
69 |