@@ -17,7 +17,6 @@ |
||
17 | 17 | * @method bool isStructural() |
18 | 18 | * @method static Navigation(): self Represents a property implementing @see IEdmNavigationProperty |
19 | 19 | * @method bool isNavigation() |
20 | - |
|
21 | 20 | */ |
22 | 21 | class PropertyKind extends Enum |
23 | 22 | { |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | protected const None = null; |
28 | 28 | protected const TypeDefinition = 'SchemaType'; |
29 | - protected const Function = 'Function'; |
|
29 | + protected const function = 'Function'; |
|
30 | 30 | protected const ValueTerm = 'ValueTerm'; |
31 | 31 | protected const EntityContainer = 'EntityContainer'; |
32 | 32 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | protected const IntegerConstant = 8; |
80 | 80 | protected const StringConstant = 9; |
81 | 81 | protected const TimeConstant = 10; |
82 | - protected const Null = 11; |
|
82 | + protected const null = 11; |
|
83 | 83 | protected const Record = 12; |
84 | 84 | protected const Collection = 14; |
85 | 85 | protected const Path = 15; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | protected const ValueTermReference = 19; |
90 | 90 | protected const EntitySetReference = 20; |
91 | 91 | protected const EnumMemberReference = 21; |
92 | - protected const If = 22; |
|
92 | + protected const if = 22; |
|
93 | 93 | protected const AssertType = 23; |
94 | 94 | protected const IsType = 24; |
95 | 95 | protected const FunctionApplication = 25; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $regexBase = '/(is)(%s)/m'; |
25 | 25 | $regexFull = sprintf($regexBase, implode('$|', array_keys($array))); |
26 | 26 | preg_match($regexFull, $name, $match); |
27 | - if (count($match)>0 && $match[0] === $name) { |
|
27 | + if (count($match) > 0 && $match[0] === $name) { |
|
28 | 28 | return $this->{$match[1] . 'Flag'}($array[$match[2]], $arguments[0] ?? null); |
29 | 29 | } |
30 | 30 | throw new BadMethodCallException(sprintf('Enum %s not found on %s', $name, get_class($this))); |
@@ -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; |
@@ -44,8 +44,7 @@ |
||
44 | 44 | array $valueTermDictionary, |
45 | 45 | array $functionGroupDictionary, |
46 | 46 | array $containerDictionary |
47 | - ) |
|
48 | - { |
|
47 | + ) { |
|
49 | 48 | $qualifiedName = $element->FullName(); |
50 | 49 | switch ($element->getSchemaElementKind()) { |
51 | 50 | case SchemaElementKind::Function(): |
@@ -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; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | public static function assertSignatureMatches(callable $expected, callable $actual, string $callablePropName): bool |
21 | 21 | { |
22 | - if(!self::performAsserts()){ |
|
22 | + if (!self::performAsserts()) { |
|
23 | 23 | return true; |
24 | 24 | } |
25 | 25 | $expectedReflection = self::getReflection($expected); |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | ); |
35 | 35 | }; |
36 | 36 | assert( |
37 | - $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
|
37 | + $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
|
38 | 38 | $messageBuilder('Incorrect Parameter Count') |
39 | 39 | ); |
40 | - if($expectedReflection->hasReturnType()){ |
|
40 | + if ($expectedReflection->hasReturnType()) { |
|
41 | 41 | assert( |
42 | 42 | $actualReflection->hasReturnType(), |
43 | 43 | $messageBuilder('Missing Return Type') |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $expectedReflection->getReturnType()->getName() === $actualReflection->getReturnType()->getName(), |
48 | 48 | $messageBuilder('IncorrectOrInvalid ReturnType') |
49 | 49 | ); |
50 | - if(!$expectedReflection->getReturnType()->allowsNull()){ |
|
50 | + if (!$expectedReflection->getReturnType()->allowsNull()) { |
|
51 | 51 | assert( |
52 | 52 | !$actualReflection->getReturnType()->allowsNull(), |
53 | 53 | $messageBuilder('Nullable ReturnType Not allowed') |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | - for($i = 0; $i < $expectedReflection->getNumberOfParameters(); $i++){ |
|
59 | - if($expectedReflection->getParameters()[$i]->hasType()){ |
|
58 | + for ($i = 0; $i < $expectedReflection->getNumberOfParameters(); $i++) { |
|
59 | + if ($expectedReflection->getParameters()[$i]->hasType()) { |
|
60 | 60 | assert( |
61 | 61 | $actualReflection->getParameters()[$i]->hasType(), |
62 | 62 | $messageBuilder(sprintf('Parameter %s Is missing TypeHint', $i)) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $expectedReflection->getParameters()[$i]->getType()->getName() === $actualReflection->getParameters()[$i]->getType()->getName(), |
67 | 67 | $messageBuilder(sprintf('Parameter %s has Incorrect Type', $i)) |
68 | 68 | ); |
69 | - if(!$expectedReflection->getParameters()[$i]->allowsNull()){ |
|
69 | + if (!$expectedReflection->getParameters()[$i]->allowsNull()) { |
|
70 | 70 | assert( |
71 | 71 | !$actualReflection->getParameters()[$i]->allowsNull(), |
72 | 72 | $messageBuilder(sprintf('Parameter %s should disallow Nulls', $i)) |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | private static function getSignatureFromReflection(ReflectionFunctionAbstract $reflection): string |
81 | 81 | { |
82 | 82 | $parameters = []; |
83 | - foreach($reflection->getParameters() as $parameter) { |
|
83 | + foreach ($reflection->getParameters() as $parameter) { |
|
84 | 84 | $parameterString = ''; |
85 | - if($parameter->hasType()){ |
|
85 | + if ($parameter->hasType()) { |
|
86 | 86 | $parameterString .= $parameter->getType()->allowsNull() ? '?' : ''; |
87 | - $parameterString .=$parameter->getType()->getName() . ' '; |
|
87 | + $parameterString .= $parameter->getType()->getName() . ' '; |
|
88 | 88 | } |
89 | 89 | $parameterString .= $parameter->isVariadic() ? '...$' : '$'; |
90 | 90 | $parameterString .= $parameter->getName(); |
91 | - if($parameter->isOptional()){ |
|
91 | + if ($parameter->isOptional()) { |
|
92 | 92 | try { |
93 | 93 | $parameterString .= ' = ' . strval($parameter->getDefaultValue()); |
94 | 94 | } catch (ReflectionException $e) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $parameters[] = $parameterString; |
98 | 98 | } |
99 | 99 | $return = ''; |
100 | - if($reflection->hasReturnType()){ |
|
100 | + if ($reflection->hasReturnType()) { |
|
101 | 101 | $return .= ': ' . $reflection->getReturnType()->getName(); |
102 | 102 | } |
103 | 103 | return sprintf('function(%s)%s', implode(',', $parameters), $return); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | public static function assertSignatureMatches(callable $expected, callable $actual, string $callablePropName): bool |
21 | 21 | { |
22 | - if(!self::performAsserts()){ |
|
22 | + if(!self::performAsserts()) { |
|
23 | 23 | return true; |
24 | 24 | } |
25 | 25 | $expectedReflection = self::getReflection($expected); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
38 | 38 | $messageBuilder('Incorrect Parameter Count') |
39 | 39 | ); |
40 | - if($expectedReflection->hasReturnType()){ |
|
40 | + if($expectedReflection->hasReturnType()) { |
|
41 | 41 | assert( |
42 | 42 | $actualReflection->hasReturnType(), |
43 | 43 | $messageBuilder('Missing Return Type') |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $expectedReflection->getReturnType()->getName() === $actualReflection->getReturnType()->getName(), |
48 | 48 | $messageBuilder('IncorrectOrInvalid ReturnType') |
49 | 49 | ); |
50 | - if(!$expectedReflection->getReturnType()->allowsNull()){ |
|
50 | + if(!$expectedReflection->getReturnType()->allowsNull()) { |
|
51 | 51 | assert( |
52 | 52 | !$actualReflection->getReturnType()->allowsNull(), |
53 | 53 | $messageBuilder('Nullable ReturnType Not allowed') |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | - for($i = 0; $i < $expectedReflection->getNumberOfParameters(); $i++){ |
|
59 | - if($expectedReflection->getParameters()[$i]->hasType()){ |
|
58 | + for($i = 0; $i < $expectedReflection->getNumberOfParameters(); $i++) { |
|
59 | + if($expectedReflection->getParameters()[$i]->hasType()) { |
|
60 | 60 | assert( |
61 | 61 | $actualReflection->getParameters()[$i]->hasType(), |
62 | 62 | $messageBuilder(sprintf('Parameter %s Is missing TypeHint', $i)) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $expectedReflection->getParameters()[$i]->getType()->getName() === $actualReflection->getParameters()[$i]->getType()->getName(), |
67 | 67 | $messageBuilder(sprintf('Parameter %s has Incorrect Type', $i)) |
68 | 68 | ); |
69 | - if(!$expectedReflection->getParameters()[$i]->allowsNull()){ |
|
69 | + if(!$expectedReflection->getParameters()[$i]->allowsNull()) { |
|
70 | 70 | assert( |
71 | 71 | !$actualReflection->getParameters()[$i]->allowsNull(), |
72 | 72 | $messageBuilder(sprintf('Parameter %s should disallow Nulls', $i)) |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $parameters = []; |
83 | 83 | foreach($reflection->getParameters() as $parameter) { |
84 | 84 | $parameterString = ''; |
85 | - if($parameter->hasType()){ |
|
85 | + if($parameter->hasType()) { |
|
86 | 86 | $parameterString .= $parameter->getType()->allowsNull() ? '?' : ''; |
87 | 87 | $parameterString .=$parameter->getType()->getName() . ' '; |
88 | 88 | } |
89 | 89 | $parameterString .= $parameter->isVariadic() ? '...$' : '$'; |
90 | 90 | $parameterString .= $parameter->getName(); |
91 | - if($parameter->isOptional()){ |
|
91 | + if($parameter->isOptional()) { |
|
92 | 92 | try { |
93 | 93 | $parameterString .= ' = ' . strval($parameter->getDefaultValue()); |
94 | 94 | } catch (ReflectionException $e) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $parameters[] = $parameterString; |
98 | 98 | } |
99 | 99 | $return = ''; |
100 | - if($reflection->hasReturnType()){ |
|
100 | + if($reflection->hasReturnType()) { |
|
101 | 101 | $return .= ': ' . $reflection->getReturnType()->getName(); |
102 | 102 | } |
103 | 103 | return sprintf('function(%s)%s', implode(',', $parameters), $return); |
@@ -17,5 +17,5 @@ |
||
17 | 17 | /** |
18 | 18 | * @return bool gets a value indicating whether the value of this boolean value is true or false |
19 | 19 | */ |
20 | - public function getValue(): bool ; |
|
20 | + public function getValue(): bool; |
|
21 | 21 | } |
@@ -19,5 +19,5 @@ |
||
19 | 19 | /** |
20 | 20 | * @return DateTime gets the definition of this datetime value |
21 | 21 | */ |
22 | - public function getValue(): DateTime ; |
|
22 | + public function getValue(): DateTime; |
|
23 | 23 | } |
@@ -17,5 +17,5 @@ |
||
17 | 17 | /** |
18 | 18 | * @return float gets the definition of this floating value |
19 | 19 | */ |
20 | - public function getValue(): float ; |
|
20 | + public function getValue(): float; |
|
21 | 21 | } |