@@ -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( |
@@ -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); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | ) { |
49 | 49 | $qualifiedName = $element->fullName(); |
50 | 50 | switch ($element->getSchemaElementKind()) { |
51 | - case SchemaElementKind::Function(): |
|
51 | + case SchemaElementKind::Function (): |
|
52 | 52 | assert($element instanceof IFunction); |
53 | 53 | self::addFunction($element, $qualifiedName, $functionGroupDictionary); |
54 | 54 | break; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $references[] = $expression->getReferencedParameter(); |
18 | 18 | return null; |
19 | 19 | } else { |
20 | - return [ InterfaceValidator::createPropertyMustNotBeNullError($expression, 'ReferencedParameter') ]; |
|
20 | + return [InterfaceValidator::createPropertyMustNotBeNullError($expression, 'ReferencedParameter')]; |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | assert($value instanceof IBinaryValue); |
16 | 16 | return null === $value->getValue() ? |
17 | - [InterfaceValidator::createPropertyMustNotBeNullError($value, 'Value') ] |
|
17 | + [InterfaceValidator::createPropertyMustNotBeNullError($value, 'Value')] |
|
18 | 18 | : |
19 | 19 | null; |
20 | 20 | } |
@@ -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 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $primitive = $typeRef->getDefinition(); |
18 | 18 | assert($primitive instanceof IPrimitiveType); |
19 | 19 | return null !== $typeRef->getDefinition() && !$primitive->getPrimitiveKind()->isString() |
20 | - ? [ InterfaceValidator::createTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
20 | + ? [InterfaceValidator::createTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function forType(): string |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | assert($value instanceof IPropertyValue); |
16 | 16 | return null === $value->getName() ? |
17 | - [ InterfaceValidator::createPropertyMustNotBeNullError($value, 'Name') ] |
|
17 | + [InterfaceValidator::createPropertyMustNotBeNullError($value, 'Name')] |
|
18 | 18 | : |
19 | 19 | null; |
20 | 20 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $followup[] = $type->getElementType(); |
19 | 19 | return null; |
20 | 20 | } else { |
21 | - return[ InterfaceValidator::createPropertyMustNotBeNullError($type, 'ElementType')]; |
|
21 | + return[InterfaceValidator::createPropertyMustNotBeNullError($type, 'ElementType')]; |
|
22 | 22 | } |
23 | 23 | } |
24 | 24 |