Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
37 | 85 | public function getNonBuiltInTypeForParameter(string $name): string |
|
38 | { |
||
39 | 85 | $parameter = $this->getParameterByName($name); |
|
40 | |||
41 | 84 | $type = $parameter->getType(); |
|
42 | 84 | if ($type === null || $type->isBuiltin()) { |
|
43 | 2 | throw new ConfigurationException(sprintf( |
|
44 | 2 | 'Expected non built-in type-hint for %s in %s', |
|
45 | 2 | '$' . $parameter->getName(), |
|
46 | 2 | $this->getFriendlyName() |
|
47 | )); |
||
48 | } |
||
49 | |||
50 | // `$type->getName()` should be used when 7.0 support is dropped |
||
51 | 82 | return (string)$type; |
|
52 | } |
||
53 | |||
63 |