Passed
Pull Request — master (#40)
by Alex
03:15
created
ValidationRules/IComplexType/ComplexTypeInvalidAbstractComplexType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $complexType)
22 22
     {
23 23
         assert($complexType instanceof IComplexType);
24
-        if ($complexType->isAbstract())
25
-        {
24
+        if ($complexType->isAbstract()) {
26 25
             $context->AddError(
27 26
                 $complexType->Location(),
28 27
                 EdmErrorCode::InvalidAbstractComplexType(),
Please login to merge, or discard this patch.
ValidationRules/IRecordExpression/RecordExpressionPropertiesMatchType.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,12 +23,10 @@
 block discarded – undo
23 23
         if (
24 24
             $expression->getDeclaredType() != null &&
25 25
             !$context->checkIsBad($expression) &&
26
-            !$context->checkIsBad($expression->getDeclaredType()))
27
-        {
26
+            !$context->checkIsBad($expression->getDeclaredType())) {
28 27
             $discoveredErrors = null;
29 28
             ExpressionTypeChecker::TryAssertRecordAsType($expression, $expression->getDeclaredType(),  null, false, $discoveredErrors);
30
-            foreach ($discoveredErrors as $error)
31
-            {
29
+            foreach ($discoveredErrors as $error) {
32 30
                 $context->AddRawError($error);
33 31
             }
34 32
         }
Please login to merge, or discard this patch.
EntitySetNavigationPropertyMappingMustPointToValidTargetForProperty.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $set)
22 22
     {
23 23
         assert($set instanceof IEntitySet);
24
-        foreach ($set->getNavigationTargets() as $mapping)
25
-        {
24
+        foreach ($set->getNavigationTargets() as $mapping) {
26 25
             if (
27 26
                 !(
28 27
                     $mapping->getTargetEntitySet()->getElementType()->IsOrInheritsFrom(
@@ -31,8 +30,7 @@  discard block
 block discarded – undo
31 30
                     $mapping->getNavigationProperty()->ToEntityType()->IsOrInheritsFrom(
32 31
                         $mapping->getTargetEntitySet()->getElementType())
33 32
                 ) &&
34
-                !$context->checkIsBad($mapping->getTargetEntitySet()))
35
-            {
33
+                !$context->checkIsBad($mapping->getTargetEntitySet())) {
36 34
                 $context->AddError(
37 35
                     $set->Location(),
38 36
                     EdmErrorCode::EntitySetNavigationPropertyMappingMustPointToValidTargetForProperty(),
Please login to merge, or discard this patch.
...SetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,13 +22,11 @@
 block discarded – undo
22 22
     public function __invoke(ValidationContext $context, ?IEdmElement $set)
23 23
     {
24 24
         assert($set instanceof IEntitySet);
25
-        foreach ($set->getNavigationTargets() as $mapping)
26
-        {
25
+        foreach ($set->getNavigationTargets() as $mapping) {
27 26
             if (
28 27
                 $mapping->getNavigationProperty()->containsTarget() &&
29 28
                 $mapping->getNavigationProperty()->getDeclaringType()->IsOrInheritsFrom($mapping->getNavigationProperty()->ToEntityType()) &&
30
-                $mapping->getTargetEntitySet() !== $set)
31
-            {
29
+                $mapping->getTargetEntitySet() !== $set) {
32 30
                 $context->AddError(
33 31
                     $set->Location(),
34 32
                     EdmErrorCode::EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet(),
Please login to merge, or discard this patch.
ValidationRules/IEntitySet/EntitySetAssociationSetNameMustBeValid.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,10 +19,8 @@
 block discarded – undo
19 19
     public function __invoke(ValidationContext $context, ?IEdmElement $set)
20 20
     {
21 21
         assert($set instanceof IEntitySet);
22
-        foreach ($set->getNavigationTargets() as $mapping)
23
-        {
24
-            if ($mapping->getNavigationProperty()->GetPrimary() === $mapping->getNavigationProperty())
25
-            {
22
+        foreach ($set->getNavigationTargets() as $mapping) {
23
+            if ($mapping->getNavigationProperty()->GetPrimary() === $mapping->getNavigationProperty()) {
26 24
                 Helpers::CheckForNameError(
27 25
                     $context,
28 26
                     $context->getModel()->GetAssociationSetName(
Please login to merge, or discard this patch.
Validation/ValidationRules/IEntitySet/EntitySetInaccessibleEntityType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
     public function __invoke(ValidationContext $context, ?IEdmElement $entitySet)
20 20
     {
21 21
         assert($entitySet instanceof IEntitySet);
22
-        if (!$context->checkIsBad($entitySet->getElementType()))
23
-        {
22
+        if (!$context->checkIsBad($entitySet->getElementType())) {
24 23
             Helpers::CheckForUnreachableTypeError($context, $entitySet->getElementType(), $entitySet->Location());
25 24
         }
26 25
     }
Please login to merge, or discard this patch.
IEntitySet/EntitySetNavigationMappingMustBeBidirectional.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
     public function __invoke(ValidationContext $context, ?IEdmElement $set)
23 23
     {
24 24
         assert($set instanceof IEntitySet);
25
-        foreach ($set->getNavigationTargets() as $mapping)
26
-        {
25
+        foreach ($set->getNavigationTargets() as $mapping) {
27 26
             $property = $mapping->getNavigationProperty();
28 27
 
29 28
             $opposingTarget = $mapping->getTargetEntitySet()->findNavigationTarget($property->getPartner());
@@ -34,8 +33,7 @@  discard block
 block discarded – undo
34 33
                     $opposingTarget != null ||
35 34
                     $property->getPartner()->DeclaringEntityType()->findProperty($property->getPartner()->getName()) === $property->getPartner()
36 35
                 ) &&
37
-                $opposingTarget !== $set)
38
-            {
36
+                $opposingTarget !== $set) {
39 37
                 $context->AddError(
40 38
                     $set->Location(),
41 39
                     EdmErrorCode::EntitySetNavigationMappingMustBeBidirectional(),
Please login to merge, or discard this patch.
IEntitySet/EntitySetCanOnlyBeContainedByASingleNavigationProperty.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,16 +21,12 @@
 block discarded – undo
21 21
     {
22 22
         assert($set instanceof IEntitySet);
23 23
         $containmentFound = false;
24
-        foreach ($set->getContainer()->EntitySets() as $otherSet)
25
-        {
26
-            foreach ( $otherSet->getNavigationTargets() as $mapping)
27
-            {
24
+        foreach ($set->getContainer()->EntitySets() as $otherSet) {
25
+            foreach ( $otherSet->getNavigationTargets() as $mapping) {
28 26
                 $property = $mapping->getNavigationProperty();
29 27
 
30
-                if ($mapping->getTargetEntitySet() === $set && $property->containsTarget())
31
-                {
32
-                    if ($containmentFound)
33
-                    {
28
+                if ($mapping->getTargetEntitySet() === $set && $property->containsTarget()) {
29
+                    if ($containmentFound) {
34 30
                         $context->AddError(
35 31
                             $set->Location(),
36 32
                             EdmErrorCode::EntitySetCanOnlyBeContainedByASingleNavigationProperty(),
Please login to merge, or discard this patch.
src/Edm/Validation/ValidationRules/IEntitySet/EntitySetTypeHasNoKeys.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
                 $entitySet->getElementType()->Key() === null ||
27 27
                 count($entitySet->getElementType()->Key()) !== 0
28 28
             ) &&
29
-            !$context->checkIsBad($entitySet->getElementType()))
30
-        {
29
+            !$context->checkIsBad($entitySet->getElementType())) {
31 30
 
32 31
             $context->AddError(
33 32
                 $entitySet->Location(),
Please login to merge, or discard this patch.