Passed
Pull Request — master (#40)
by Alex
03:15
created
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfICollectionType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,14 +13,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Validation/Internal/InterfaceValidator/VisitorOfITemporalTypeReference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Internal/InterfaceValidator/VisitorOfIParameterReferenceExpression.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,13 +13,10 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Edm/Validation/Internal/InterfaceValidator/VisitorOfIEnumTypeReference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Edm/Validation/Internal/InterfaceValidator/VisitorOfIIsTypeExpression.php 1 patch
Braces   +4 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,12 +15,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfILabeledElement.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,13 +13,10 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIType.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIIfExpression.php 1 patch
Braces   +6 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,12 +15,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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"
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIExpression.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,8 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.