@@ -56,12 +56,10 @@ |
||
56 | 56 | $stem = is_array($isBad) ? new ReflectionMethod(...$isBad) : new ReflectionFunction($isBad); |
57 | 57 | $stemReturnType = $stem->getReturnType(); |
58 | 58 | $stemName = $stemReturnType instanceof ReflectionNamedType ? |
59 | - $stemReturnType->getName() : |
|
60 | - strval($stemReturnType); |
|
59 | + $stemReturnType->getName() : strval($stemReturnType); |
|
61 | 60 | $stemParmType = $stem->getParameters()[0]->getType(); |
62 | 61 | $stemParmName = $stemParmType instanceof ReflectionNamedType ? |
63 | - $stemParmType->getName() : |
|
64 | - strval($stemParmType); |
|
62 | + $stemParmType->getName() : strval($stemParmType); |
|
65 | 63 | |
66 | 64 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts. */ |
67 | 65 | assert( |
@@ -1352,8 +1352,7 @@ discard block |
||
1352 | 1352 | */ |
1353 | 1353 | public function WriteOptionalAttribute(string $attribute, $value, $defaultValue, callable $toXml): void |
1354 | 1354 | { |
1355 | - $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : |
|
1356 | - new ReflectionFunction($toXml); |
|
1355 | + $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : new ReflectionFunction($toXml); |
|
1357 | 1356 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1358 | 1357 | assert( |
1359 | 1358 | 1 === count(($stem)->getParameters()), |
@@ -1361,8 +1360,7 @@ discard block |
||
1361 | 1360 | ); |
1362 | 1361 | $stemType = $stem->getReturnType(); |
1363 | 1362 | $name = $stemType instanceof ReflectionNamedType ? |
1364 | - $stemType->getName() : |
|
1365 | - strval($stemType); |
|
1363 | + $stemType->getName() : strval($stemType); |
|
1366 | 1364 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1367 | 1365 | assert( |
1368 | 1366 | 'string' === $name, |
@@ -1381,8 +1379,7 @@ discard block |
||
1381 | 1379 | */ |
1382 | 1380 | public function WriteRequiredAttribute(string $attribute, $value, callable $toXml): void |
1383 | 1381 | { |
1384 | - $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : |
|
1385 | - new ReflectionFunction($toXml); |
|
1382 | + $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : new ReflectionFunction($toXml); |
|
1386 | 1383 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1387 | 1384 | assert( |
1388 | 1385 | 1 === count($stem->getParameters()), |
@@ -1390,8 +1387,7 @@ discard block |
||
1390 | 1387 | ); |
1391 | 1388 | $stemType = $stem->getReturnType(); |
1392 | 1389 | $name = $stemType instanceof ReflectionNamedType ? |
1393 | - $stemType->getName() : |
|
1394 | - strval($stemType); |
|
1390 | + $stemType->getName() : strval($stemType); |
|
1395 | 1391 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1396 | 1392 | assert( |
1397 | 1393 | 'string' === $name, |
@@ -1488,7 +1484,7 @@ discard block |
||
1488 | 1484 | |
1489 | 1485 | private static function SridAsXml(?int $i): string |
1490 | 1486 | { |
1491 | - return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable; |
|
1487 | + return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable; |
|
1492 | 1488 | } |
1493 | 1489 | |
1494 | 1490 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ); |
37 | 37 | }; |
38 | 38 | assert( |
39 | - $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
|
39 | + $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
|
40 | 40 | $messageBuilder('Incorrect Parameter Count') |
41 | 41 | ); |
42 | 42 | if ($expectedReflection->hasReturnType()) { |
@@ -48,11 +48,9 @@ discard block |
||
48 | 48 | $expectedReturnType = $expectedReflection->getReturnType(); |
49 | 49 | $actualReturnType = $actualReflection->getReturnType(); |
50 | 50 | $name = $expectedReturnType instanceof ReflectionNamedType ? |
51 | - $expectedReturnType->getName() : |
|
52 | - strval($expectedReturnType); |
|
51 | + $expectedReturnType->getName() : strval($expectedReturnType); |
|
53 | 52 | $actName = $actualReturnType instanceof ReflectionNamedType ? |
54 | - $actualReturnType->getName() : |
|
55 | - strval($actualReturnType); |
|
53 | + $actualReturnType->getName() : strval($actualReturnType); |
|
56 | 54 | |
57 | 55 | assert( |
58 | 56 | $name === $actName, |
@@ -77,11 +75,9 @@ discard block |
||
77 | 75 | $expectedParmType = $expectedParm->getType(); |
78 | 76 | $actualParmType = $actualParm->getType(); |
79 | 77 | $name = $expectedParmType instanceof ReflectionNamedType ? |
80 | - $expectedParmType->getName() : |
|
81 | - strval($expectedParmType); |
|
78 | + $expectedParmType->getName() : strval($expectedParmType); |
|
82 | 79 | $actName = $actualParmType instanceof ReflectionNamedType ? |
83 | - $actualParmType->getName() : |
|
84 | - strval($actualParmType); |
|
80 | + $actualParmType->getName() : strval($actualParmType); |
|
85 | 81 | |
86 | 82 | //TODO: improve this to check that the actual type does not return a childType; |
87 | 83 | assert( |
@@ -107,8 +103,7 @@ discard block |
||
107 | 103 | if ($parameter->hasType()) { |
108 | 104 | $parmType = $parameter->getType(); |
109 | 105 | $parmName = $parmType instanceof ReflectionNamedType ? |
110 | - $parmType->getName() : |
|
111 | - strval($parmType); |
|
106 | + $parmType->getName() : strval($parmType); |
|
112 | 107 | $parameterString .= $parmType->allowsNull() ? '?' : ''; |
113 | 108 | $parameterString .= $parmName . ' '; |
114 | 109 | } |
@@ -127,8 +122,7 @@ discard block |
||
127 | 122 | if ($reflection->hasReturnType()) { |
128 | 123 | $returnType = $reflection->getReturnType(); |
129 | 124 | $name = $returnType instanceof ReflectionNamedType ? |
130 | - $returnType->getName() : |
|
131 | - strval($returnType); |
|
125 | + $returnType->getName() : strval($returnType); |
|
132 | 126 | $return .= ': ' . $name; |
133 | 127 | } |
134 | 128 | return sprintf('function(%s)%s', implode(',', $parameters), $return); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | assert($typeRef instanceof ICollectionTypeReference); |
16 | 16 | return null !== $typeRef->getDefinition() && |
17 | 17 | !$typeRef->getDefinition()->getTypeKind()->isCollection() ? |
18 | - [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)]: null; |
|
18 | + [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function forType(): string |
@@ -16,7 +16,7 @@ |
||
16 | 16 | assert($typeRef instanceof IRowTypeReference); |
17 | 17 | return null !== $typeRef->getDefinition() && |
18 | 18 | $typeRef->getDefinition()->getTypeKind() != TypeKind::Row() |
19 | - ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
19 | + ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function forType(): string |