@@ -20,7 +20,7 @@ |
||
20 | 20 | public function __construct() |
21 | 21 | { |
22 | 22 | $this->lookup[SchemaElementKind::TypeDefinition()->getKey()] = ISchemaType::class; |
23 | - $this->lookup[SchemaElementKind::Function()->getKey()] = IFunction::class; |
|
23 | + $this->lookup[SchemaElementKind::Function ()->getKey()] = IFunction::class; |
|
24 | 24 | $this->lookup[SchemaElementKind::ValueTerm()->getKey()] = IValueTerm::class; |
25 | 25 | $this->lookup[SchemaElementKind::EntityContainer()->getKey()] = IEntityContainer::class; |
26 | 26 | } |
@@ -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; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | case $element instanceof IProperty: |
54 | 54 | assert($element instanceof IProperty); |
55 | 55 | $type = $element->getType(); |
56 | - return $element->getName() ?? '' . ':' . ($type !== null ? self::toTraceString($type) :''); |
|
56 | + return $element->getName() ?? '' . ':' . ($type !== null ? self::toTraceString($type) : ''); |
|
57 | 57 | case $element instanceof IEntityReferenceType: |
58 | 58 | assert($element instanceof IEntityReferenceType); |
59 | 59 | return strval(TypeKind::EntityReference()->getKey()) . '(' . (null !== $element->getEntityType() ? |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $sb, |
189 | 189 | EdmConstants::FacetName_Srid, |
190 | 190 | null !== $type->getSpatialReferenceIdentifier() |
191 | - ? $type->getSpatialReferenceIdentifier(): EdmConstants::Value_SridVariable |
|
191 | + ? $type->getSpatialReferenceIdentifier() : EdmConstants::Value_SridVariable |
|
192 | 192 | ); |
193 | 193 | return $sb; |
194 | 194 | } |
@@ -36,6 +36,6 @@ |
||
36 | 36 | public function primitiveKind(): PrimitiveTypeKind |
37 | 37 | { |
38 | 38 | $primitive = $this->primitiveDefinition(); |
39 | - return $primitive !== null ? $primitive->getPrimitiveKind(): PrimitiveTypeKind::None(); |
|
39 | + return $primitive !== null ? $primitive->getPrimitiveKind() : PrimitiveTypeKind::None(); |
|
40 | 40 | } |
41 | 41 | } |
@@ -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 |
@@ -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 |
@@ -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 | } |