@@ -47,7 +47,7 @@ |
||
47 | 47 | break; |
48 | 48 | } |
49 | 49 | |
50 | - return null !== $termKindError ? [ $termKindError ] : null; |
|
50 | + return null !== $termKindError ? [$termKindError] : null; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function forType(): string |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $this->lookup[ExpressionKind::ValueTermReference()->getValue()] = IValueTermReferenceExpression::class; |
62 | 62 | $this->lookup[ExpressionKind::EntitySetReference()->getValue()] = IEntitySetReferenceExpression::class; |
63 | 63 | $this->lookup[ExpressionKind::EnumMemberReference()->getValue()] = IEnumMemberReferenceExpression::class; |
64 | - $this->lookup[ExpressionKind::If()->getValue()] = IIfExpression::class; |
|
64 | + $this->lookup[ExpressionKind::If ()->getValue()] = IIfExpression::class; |
|
65 | 65 | $this->lookup[ExpressionKind::AssertType()->getValue()] = IAssertTypeExpression::class; |
66 | 66 | $this->lookup[ExpressionKind::IsType()->getValue()] = IIsTypeExpression::class; |
67 | 67 | $this->lookup[ExpressionKind::FunctionApplication()->getValue()] = IApplyExpression::class; |
@@ -61,7 +61,9 @@ |
||
61 | 61 | $this->lookup[ExpressionKind::ValueTermReference()->getValue()] = IValueTermReferenceExpression::class; |
62 | 62 | $this->lookup[ExpressionKind::EntitySetReference()->getValue()] = IEntitySetReferenceExpression::class; |
63 | 63 | $this->lookup[ExpressionKind::EnumMemberReference()->getValue()] = IEnumMemberReferenceExpression::class; |
64 | - $this->lookup[ExpressionKind::If()->getValue()] = IIfExpression::class; |
|
64 | + $this->lookup[ExpressionKind::If() { |
|
65 | + ->getValue()] = IIfExpression::class; |
|
66 | + } |
|
65 | 67 | $this->lookup[ExpressionKind::AssertType()->getValue()] = IAssertTypeExpression::class; |
66 | 68 | $this->lookup[ExpressionKind::IsType()->getValue()] = IIsTypeExpression::class; |
67 | 69 | $this->lookup[ExpressionKind::FunctionApplication()->getValue()] = IApplyExpression::class; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->lookup[ExpressionKind::DecimalConstant()->getValue()] = IDecimalConstantExpression::class; |
52 | 52 | $this->lookup[ExpressionKind::FloatingConstant()->getValue()] = IFloatingConstantExpression::class; |
53 | 53 | $this->lookup[ExpressionKind::GuidConstant()->getValue()] = IGuidConstantExpression::class; |
54 | - $this->lookup[ExpressionKind::Null()->getValue()] = INullExpression::class; |
|
54 | + $this->lookup[ExpressionKind::null()->getValue()] = INullExpression::class; |
|
55 | 55 | $this->lookup[ExpressionKind::Record()->getValue()] = IRecordExpression::class; |
56 | 56 | $this->lookup[ExpressionKind::Collection()->getValue()] = ICollectionExpression::class; |
57 | 57 | $this->lookup[ExpressionKind::Path()->getValue()] = IPathExpression::class; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->lookup[ExpressionKind::ValueTermReference()->getValue()] = IValueTermReferenceExpression::class; |
62 | 62 | $this->lookup[ExpressionKind::EntitySetReference()->getValue()] = IEntitySetReferenceExpression::class; |
63 | 63 | $this->lookup[ExpressionKind::EnumMemberReference()->getValue()] = IEnumMemberReferenceExpression::class; |
64 | - $this->lookup[ExpressionKind::If()->getValue()] = IIfExpression::class; |
|
64 | + $this->lookup[ExpressionKind::if()->getValue()] = IIfExpression::class; |
|
65 | 65 | $this->lookup[ExpressionKind::AssertType()->getValue()] = IAssertTypeExpression::class; |
66 | 66 | $this->lookup[ExpressionKind::IsType()->getValue()] = IIsTypeExpression::class; |
67 | 67 | $this->lookup[ExpressionKind::FunctionApplication()->getValue()] = IApplyExpression::class; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public function getExpressionKind(): ExpressionKind |
49 | 49 | { |
50 | - return ExpressionKind::If(); |
|
50 | + return ExpressionKind::If (); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public function getExpressionKind(): ExpressionKind |
49 | 49 | { |
50 | - return ExpressionKind::If(); |
|
50 | + return ExpressionKind::if(); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function getValueKind(): ValueKind |
34 | 34 | { |
35 | - return ValueKind::Null(); |
|
35 | + return ValueKind::null(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -40,6 +40,6 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getExpressionKind(): ExpressionKind |
42 | 42 | { |
43 | - return ExpressionKind::Null(); |
|
43 | + return ExpressionKind::null(); |
|
44 | 44 | } |
45 | 45 | } |
@@ -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 | } |
@@ -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( |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $this->lookup[ValueKind::Floating()->getValue()] = IFloatingValue::class; |
40 | 40 | $this->lookup[ValueKind::Guid()->getValue()] = IGuidValue::class; |
41 | 41 | $this->lookup[ValueKind::Integer()->getValue()] = IIntegerValue::class; |
42 | - $this->lookup[ValueKind::Null()->getValue()] = INullValue::class; |
|
42 | + $this->lookup[ValueKind::null()->getValue()] = INullValue::class; |
|
43 | 43 | $this->lookup[ValueKind::String()->getValue()] = IStringValue::class; |
44 | 44 | $this->lookup[ValueKind::Structured()->getValue()] = IStructuredValue::class; |
45 | 45 | $this->lookup[ValueKind::Time()->getValue()] = ITimeValue::class; |
@@ -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; |
@@ -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; |