Passed
Pull Request — master (#40)
by Alex
03:15
created
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIFunctionBase.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
         // Return type is optional for function imports and is required for MDFs. Both cases are derived interfaces (IEdmFunctionImport and IEdmFunction).
21 21
         // So, from the point of view of this interface, we consider return type as optional and it is expected that IEdmFunction visitor will have
22 22
         // an additional null check for the return type.
23
-        if ($function->getReturnType() != null)
24
-        {
23
+        if ($function->getReturnType() != null) {
25 24
             // Function owns its return type reference, so it goes as a followup.
26 25
             $followup[] = $function->getReturnType();
27 26
         }
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIEntitySet.php 1 patch
Braces   +7 added lines, -17 removed lines patch added patch discarded remove patch
@@ -16,12 +16,9 @@  discard block
 block discarded – undo
16 16
         assert($item instanceof IEntitySet);
17 17
         $errors = null;
18 18
 
19
-        if ($item->getElementType() != null)
20
-        {
19
+        if ($item->getElementType() != null) {
21 20
             $references[] = $item->getElementType();
22
-        }
23
-        else
24
-        {
21
+        } else {
25 22
             InterfaceValidator::CollectErrors(
26 23
                 InterfaceValidator::CreatePropertyMustNotBeNullError(
27 24
                     $item,
@@ -41,14 +38,10 @@  discard block
 block discarded – undo
41 38
         /**
42 39
          * @var INavigationTargetMapping $navTargetMapping
43 40
          */
44
-        foreach ($navTargetMappings as $navTargetMapping)
45
-        {
46
-            if ($navTargetMapping->getNavigationProperty() != null)
47
-            {
41
+        foreach ($navTargetMappings as $navTargetMapping) {
42
+            if ($navTargetMapping->getNavigationProperty() != null) {
48 43
                 $references[] = $navTargetMapping->getNavigationProperty();
49
-            }
50
-            else
51
-            {
44
+            } else {
52 45
                 InterfaceValidator::CollectErrors(
53 46
                     InterfaceValidator::CreatePropertyMustNotBeNullError(
54 47
                         $navTargetMapping,
@@ -57,12 +50,9 @@  discard block
 block discarded – undo
57 50
                     $errors);
58 51
             }
59 52
 
60
-            if ($navTargetMapping->getTargetEntitySet() != null)
61
-            {
53
+            if ($navTargetMapping->getTargetEntitySet() != null) {
62 54
                 $references[] = $navTargetMapping->getTargetEntitySet();
63
-            }
64
-            else
65
-            {
55
+            } else {
66 56
                 InterfaceValidator::CollectErrors(
67 57
                     InterfaceValidator::CreatePropertyMustNotBeNullError(
68 58
                         $navTargetMapping,
Please login to merge, or discard this patch.
Internal/InterfaceValidator/VisitorOfIValueTermReferenceExpression.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 IValueTermReferenceExpression);
16 16
         $errors = null;
17 17
 
18
-                if ($expression->getBase() != null)
19
-                {
18
+                if ($expression->getBase() != null) {
20 19
                     $followup[] = $expression->getBase();
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->getTerm() != null)
34
-                {
30
+                if ($expression->getTerm() != null) {
35 31
                     $references[] = $expression->getTerm();
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.
Edm/Validation/Internal/InterfaceValidator/VisitorOfIFunctionParameter.php 1 patch
Braces   +5 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,13 +17,10 @@  discard block
 block discarded – undo
17 17
 
18 18
         $errors = null;
19 19
 
20
-                if ($parameter->getType() != null)
21
-                {
20
+                if ($parameter->getType() != null) {
22 21
                     // Parameter owns its type reference, so it goes as a followup.
23 22
                     $followup[] = $parameter->getType();
24
-                }
25
-                else
26
-                {
23
+                } else {
27 24
                     InterfaceValidator::CollectErrors(
28 25
                         InterfaceValidator::CreatePropertyMustNotBeNullError(
29 26
                             $parameter, "Type"
@@ -32,12 +29,9 @@  discard block
 block discarded – undo
32 29
                     );
33 30
                 }
34 31
 
35
-                if ($parameter->getDeclaringFunction() != null)
36
-                {
32
+                if ($parameter->getDeclaringFunction() != null) {
37 33
                     $references[] = $parameter->getDeclaringFunction();
38
-                }
39
-                else
40
-                {
34
+                } else {
41 35
                     InterfaceValidator::CollectErrors(
42 36
                         InterfaceValidator::CreatePropertyMustNotBeNullError(
43 37
                             $parameter,
@@ -48,8 +42,7 @@  discard block
 block discarded – undo
48 42
                 }
49 43
 
50 44
                 if ($parameter->getMode()->getValue() < FunctionParameterMode::None()->getValue() ||
51
-                    $parameter->getMode()->getValue() > FunctionParameterMode::InOut()->getValue())
52
-                {
45
+                    $parameter->getMode()->getValue() > FunctionParameterMode::InOut()->getValue()) {
53 46
                     InterfaceValidator::CollectErrors(
54 47
                         InterfaceValidator::CreateEnumPropertyOutOfRangeError(
55 48
                             $parameter,
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIEntityType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@
 block discarded – undo
14 14
     {
15 15
         assert($type instanceof IEntityType);
16 16
         $errors = null;
17
-                if ($type->getDeclaredKey() != null)
18
-                {
17
+                if ($type->getDeclaredKey() != null) {
19 18
                     InterfaceValidator::ProcessEnumerable($type, $type->getDeclaredKey(), "DeclaredKey", $references, $errors);
20 19
                 }
21 20
 
Please login to merge, or discard this patch.
Validation/Internal/InterfaceValidator/VisitorOfIEntityReferenceType.php 1 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($type, array &$followup, array &$references): iterable
14 14
     {
15 15
         assert($type instanceof IEntityReferenceType);
16
-        if ($type->getEntityType() != null)
17
-        {
16
+        if ($type->getEntityType() != null) {
18 17
             $references[] = $type->getEntityType();
19 18
             return null;
20
-        }
21
-        else
22
-        {
19
+        } else {
23 20
             return [ InterfaceValidator::CreatePropertyMustNotBeNullError($type, "EntityType") ];
24 21
         }
25 22
     }
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIPrimitiveType.php 1 patch
Braces   +2 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,12 +21,9 @@
 block discarded – undo
21 21
                 $type->getPrimitiveKind()->getValue() < PrimitiveTypeKind::None()->getValue() ||
22 22
                 $type->getPrimitiveKind()->getValue() > PrimitiveTypeKind::GeometryMultiPoint()->getValue()
23 23
             )
24
-        )
25
-        {
24
+        ) {
26 25
             return [InterfaceValidator::CreateInterfaceKindValueUnexpectedError($type, $type->getPrimitiveKind()->getKey(), "PrimitiveKind") ];
27
-        }
28
-        else
29
-        {
26
+        } else {
30 27
             return null;
31 28
         }
32 29
     }
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIEnumMember.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($member instanceof IEnumMember);
16 16
         $errors = null;
17 17
 
18
-                if ($member->getDeclaringType() != null)
19
-                {
18
+                if ($member->getDeclaringType() != null) {
20 19
                     $references[] = $member->getDeclaringType();
21
-                }
22
-                else
23
-                {
20
+                } else {
24 21
                     InterfaceValidator::CollectErrors(
25 22
                         InterfaceValidator::CreatePropertyMustNotBeNullError(
26 23
                             $member,
@@ -29,12 +26,9 @@  discard block
 block discarded – undo
29 26
                     );
30 27
                 }
31 28
 
32
-                if ($member->getValue() != null)
33
-                {
29
+                if ($member->getValue() != null) {
34 30
                     $followup[] = $member->getValue();
35
-                }
36
-                else
37
-                {
31
+                } else {
38 32
                     InterfaceValidator::CollectErrors(
39 33
                         InterfaceValidator::CreatePropertyMustNotBeNullError(
40 34
                             $member,
Please login to merge, or discard this patch.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIProperty.php 1 patch
Braces   +5 added lines, -12 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@  discard block
 block discarded – undo
18 18
         assert($property instanceof IProperty);
19 19
         $errors = null;
20 20
 
21
-        switch ($property->getPropertyKind())
22
-        {
21
+        switch ($property->getPropertyKind()) {
23 22
             case PropertyKind::Structural():
24 23
                 InterfaceValidator::CollectErrors(
25 24
                     InterfaceValidator::CheckForInterfaceKindValueMismatchError(
@@ -59,13 +58,10 @@  discard block
 block discarded – undo
59 58
                 break;
60 59
         }
61 60
 
62
-        if ($property->getType() != null)
63
-        {
61
+        if ($property->getType() != null) {
64 62
             // Property owns its type reference, so it goes as a followup.
65 63
             $followup[] = $property->getType();
66
-        }
67
-        else
68
-        {
64
+        } else {
69 65
             InterfaceValidator::CollectErrors(
70 66
                 InterfaceValidator::CreatePropertyMustNotBeNullError(
71 67
                     $property,
@@ -75,12 +71,9 @@  discard block
 block discarded – undo
75 71
             );
76 72
         }
77 73
 
78
-        if ($property->getDeclaringType() != null)
79
-        {
74
+        if ($property->getDeclaringType() != null) {
80 75
             $references[] = $property->getDeclaringType();
81
-        }
82
-        else
83
-        {
76
+        } else {
84 77
             InterfaceValidator::CollectErrors(
85 78
                 InterfaceValidator::CreatePropertyMustNotBeNullError(
86 79
                     $property,
Please login to merge, or discard this patch.