@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | else |
23 | 23 | { |
24 | - return[ InterfaceValidator::CreatePropertyMustNotBeNullError($type, "ElementType")]; |
|
24 | + return[InterfaceValidator::CreatePropertyMustNotBeNullError($type, "ElementType")]; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | } |
@@ -13,14 +13,11 @@ |
||
13 | 13 | protected function VisitT($type, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($type instanceof ICollectionType); |
16 | - if ($type->getElementType() != null) |
|
17 | - { |
|
16 | + if ($type->getElementType() != null) { |
|
18 | 17 | // Collection owns its element type reference, so it goes as a followup. |
19 | 18 | $followup[] = $type->getElementType(); |
20 | 19 | return null; |
21 | - } |
|
22 | - else |
|
23 | - { |
|
20 | + } else { |
|
24 | 21 | return[ InterfaceValidator::CreatePropertyMustNotBeNullError($type, "ElementType")]; |
25 | 22 | } |
26 | 23 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | assert($typeRef instanceof ITemporalTypeReference); |
18 | 18 | $primitive = $typeRef->getDefinition(); |
19 | 19 | assert($primitive instanceof IPrimitiveType); |
20 | - return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->IsTemporal() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
20 | + return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->IsTemporal() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function forType(): string |
@@ -20,7 +20,7 @@ |
||
20 | 20 | } |
21 | 21 | else |
22 | 22 | { |
23 | - return [ InterfaceValidator::CreatePropertyMustNotBeNullError($expression, "ReferencedParameter") ]; |
|
23 | + return [InterfaceValidator::CreatePropertyMustNotBeNullError($expression, "ReferencedParameter")]; |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -13,13 +13,10 @@ |
||
13 | 13 | protected function VisitT($expression, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($expression instanceof IParameterReferenceExpression); |
16 | - if ($expression->getReferencedParameter() != null) |
|
17 | - { |
|
16 | + if ($expression->getReferencedParameter() != null) { |
|
18 | 17 | $references[] = $expression->getReferencedParameter(); |
19 | 18 | return null; |
20 | - } |
|
21 | - else |
|
22 | - { |
|
19 | + } else { |
|
23 | 20 | return [ InterfaceValidator::CreatePropertyMustNotBeNullError($expression, "ReferencedParameter") ]; |
24 | 21 | } |
25 | 22 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | protected function VisitT($typeRef, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($typeRef instanceof IEnumTypeReference); |
16 | - return $typeRef->getDefinition() != null && !$typeRef->getDefinition()->getTypeKind()->isEnum() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
16 | + return $typeRef->getDefinition() != null && !$typeRef->getDefinition()->getTypeKind()->isEnum() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
17 | 17 | |
18 | 18 | } |
19 | 19 |
@@ -15,12 +15,9 @@ discard block |
||
15 | 15 | assert($expression instanceof IIsTypeExpression); |
16 | 16 | $errors = null; |
17 | 17 | |
18 | - if ($expression->getOperand() != null) |
|
19 | - { |
|
18 | + if ($expression->getOperand() != null) { |
|
20 | 19 | $followup[] = $expression->getOperand(); |
21 | - } |
|
22 | - else |
|
23 | - { |
|
20 | + } else { |
|
24 | 21 | InterfaceValidator::CollectErrors( |
25 | 22 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
26 | 23 | $expression, |
@@ -29,13 +26,10 @@ discard block |
||
29 | 26 | ); |
30 | 27 | } |
31 | 28 | |
32 | - if ($expression->getType() != null) |
|
33 | - { |
|
29 | + if ($expression->getType() != null) { |
|
34 | 30 | // Assert owns its type reference, so it goes as a followup. |
35 | 31 | $followup[] = $expression->getType(); |
36 | - } |
|
37 | - else |
|
38 | - { |
|
32 | + } else { |
|
39 | 33 | InterfaceValidator::CollectErrors( |
40 | 34 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
41 | 35 | $expression, |
@@ -20,7 +20,7 @@ |
||
20 | 20 | } |
21 | 21 | else |
22 | 22 | { |
23 | - return [InterfaceValidator::CreatePropertyMustNotBeNullError($expression, "Expression") ]; |
|
23 | + return [InterfaceValidator::CreatePropertyMustNotBeNullError($expression, "Expression")]; |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -13,13 +13,10 @@ |
||
13 | 13 | protected function VisitT($expression, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($expression instanceof ILabeledExpression); |
16 | - if ($expression->getExpressionKind() != null) |
|
17 | - { |
|
16 | + if ($expression->getExpressionKind() != null) { |
|
18 | 17 | $followup[] = $expression->getExpressionKind(); |
19 | 18 | return null; |
20 | - } |
|
21 | - else |
|
22 | - { |
|
19 | + } else { |
|
23 | 20 | return [InterfaceValidator::CreatePropertyMustNotBeNullError($expression, "Expression") ]; |
24 | 21 | } |
25 | 22 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | break; |
29 | 29 | |
30 | 30 | case TypeKind::Entity(): |
31 | - $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind",IEntityType::class); |
|
31 | + $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind", IEntityType::class); |
|
32 | 32 | break; |
33 | 33 | |
34 | 34 | case TypeKind::Complex(): |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | break; |
41 | 41 | |
42 | 42 | case TypeKind::Collection(): |
43 | - $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind",ICollectionType::class); |
|
43 | + $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind", ICollectionType::class); |
|
44 | 44 | break; |
45 | 45 | |
46 | 46 | case TypeKind::EntityReference(): |
47 | - $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind",IEntityReferenceType::class); |
|
47 | + $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind", IEntityReferenceType::class); |
|
48 | 48 | break; |
49 | 49 | |
50 | 50 | case TypeKind::Enum(): |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | break; |
60 | 60 | } |
61 | 61 | |
62 | - return $typeKindError != null ? [$typeKindError ] : null; |
|
62 | + return $typeKindError != null ? [$typeKindError] : null; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function forType(): string |
@@ -21,8 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | assert($type instanceof IType); |
23 | 23 | $typeKindError = null; |
24 | - switch ($type->getTypeKind()) |
|
25 | - { |
|
24 | + switch ($type->getTypeKind()) { |
|
26 | 25 | case TypeKind::Primitive(): |
27 | 26 | $typeKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($type, $type->getTypeKind(), "TypeKind", IPrimitiveType::class); |
28 | 27 | break; |
@@ -15,12 +15,9 @@ discard block |
||
15 | 15 | assert($expression instanceof IIfExpression); |
16 | 16 | $errors = null; |
17 | 17 | |
18 | - if ($expression->getTestExpression() != null) |
|
19 | - { |
|
18 | + if ($expression->getTestExpression() != null) { |
|
20 | 19 | $followup[] = $expression->getTestExpression(); |
21 | - } |
|
22 | - else |
|
23 | - { |
|
20 | + } else { |
|
24 | 21 | InterfaceValidator::CollectErrors( |
25 | 22 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
26 | 23 | $expression, |
@@ -30,12 +27,9 @@ discard block |
||
30 | 27 | ); |
31 | 28 | } |
32 | 29 | |
33 | - if ($expression->getTrueExpression() != null) |
|
34 | - { |
|
30 | + if ($expression->getTrueExpression() != null) { |
|
35 | 31 | $followup[] = $expression->getTrueExpression(); |
36 | - } |
|
37 | - else |
|
38 | - { |
|
32 | + } else { |
|
39 | 33 | InterfaceValidator::CollectErrors( |
40 | 34 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
41 | 35 | $expression, |
@@ -45,12 +39,9 @@ discard block |
||
45 | 39 | ); |
46 | 40 | } |
47 | 41 | |
48 | - if ($expression->getFalseExpression() != null) |
|
49 | - { |
|
42 | + if ($expression->getFalseExpression() != null) { |
|
50 | 43 | $followup[] = $expression->getFalseExpression(); |
51 | - } |
|
52 | - else |
|
53 | - { |
|
44 | + } else { |
|
54 | 45 | InterfaceValidator::CollectErrors( |
55 | 46 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
56 | 47 | $expression, "FalseExpression" |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IEnumMemberReferenceExpression::class); |
127 | 127 | break; |
128 | 128 | |
129 | - case ExpressionKind::If(): |
|
129 | + case ExpressionKind::If (): |
|
130 | 130 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IIfExpression::class); |
131 | 131 | break; |
132 | 132 | |
133 | 133 | case ExpressionKind::AssertType(): |
134 | - $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind",IAssertTypeExpression::class); |
|
134 | + $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IAssertTypeExpression::class); |
|
135 | 135 | break; |
136 | 136 | |
137 | 137 | case ExpressionKind::IsType(): |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - return $expressionKindError != null ? [ $expressionKindError ] : null; |
|
159 | + return $expressionKindError != null ? [$expressionKindError] : null; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | public function forType(): string |
@@ -42,10 +42,8 @@ |
||
42 | 42 | assert($expression instanceof IExpression); |
43 | 43 | // Trying to reduce amount of noise in errors - if this expression is bad, then most likely it will have an unacceptable kind, no need to report it. |
44 | 44 | $expressionKindError = null; |
45 | - if (!InterfaceValidator::IsCheckableBad($expression)) |
|
46 | - { |
|
47 | - switch ($expression->getExpressionKind()) |
|
48 | - { |
|
45 | + if (!InterfaceValidator::IsCheckableBad($expression)) { |
|
46 | + switch ($expression->getExpressionKind()) { |
|
49 | 47 | case ExpressionKind::IntegerConstant(): |
50 | 48 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IIntegerConstantExpression::class); |
51 | 49 | break; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IGuidConstantExpression::class); |
87 | 87 | break; |
88 | 88 | |
89 | - case ExpressionKind::Null(): |
|
89 | + case ExpressionKind::null(): |
|
90 | 90 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", INullExpression::class); |
91 | 91 | break; |
92 | 92 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IEnumMemberReferenceExpression::class); |
127 | 127 | break; |
128 | 128 | |
129 | - case ExpressionKind::If(): |
|
129 | + case ExpressionKind::if(): |
|
130 | 130 | $expressionKindError = InterfaceValidator::CheckForInterfaceKindValueMismatchError($expression, $expression->getExpressionKind(), "ExpressionKind", IIfExpression::class); |
131 | 131 | break; |
132 | 132 |