Passed
Pull Request — master (#40)
by Alex
03:15
created
Validation/ValidationRules/IPrimitiveValue/PrimitiveValueValidForType.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,10 @@
 block discarded – undo
19 19
     public function __invoke(ValidationContext $context, ?IEdmElement $value)
20 20
     {
21 21
         assert($value instanceof IPrimitiveValue);
22
-        if ($value->getType() != null && !$context->checkIsBad($value) && !$context->checkIsBad($value->getType()))
23
-        {
22
+        if ($value->getType() != null && !$context->checkIsBad($value) && !$context->checkIsBad($value->getType())) {
24 23
             $discoveredErrors = null;
25 24
             ExpressionTypeChecker::TryAssertPrimitiveAsType($value, $value->getType(), $discoveredErrors);
26
-            foreach ($discoveredErrors as $error)
27
-            {
25
+            foreach ($discoveredErrors as $error) {
28 26
                 $context->AddRawError($error);
29 27
             }
30 28
         }
Please login to merge, or discard this patch.
src/Edm/Validation/ValidationRules/IPrimitiveValue/PrimitiveValueRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 {
12 12
     public function getValidatedType(): string
13 13
     {
14
-        return IPrimitiveValue::class ;
14
+        return IPrimitiveValue::class;
15 15
     }
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
IEntityReferenceType/EntityReferenceTypeInaccessibleEntityType.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
     public function __invoke(ValidationContext $context, ?IEdmElement $entityReferenceType)
21 21
     {
22 22
         assert($entityReferenceType instanceof IEntityReferenceType);
23
-        if (!$context->checkIsBad($entityReferenceType->getEntityType()))
24
-        {
23
+        if (!$context->checkIsBad($entityReferenceType->getEntityType())) {
25 24
             Helpers::CheckForUnreachableTypeError($context, $entityReferenceType->getEntityType(), $entityReferenceType->Location());
26 25
         }
27 26
     }
Please login to merge, or discard this patch.
ValidationRules/IValueAnnotation/ValueAnnotationInaccessibleTerm.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
         assert($annotation instanceof IValueAnnotation);
24 24
         // An unbound term is not treated as a semantic error, and looking up its name would fail.
25 25
         $term = $annotation->getTerm();
26
-        if (!($term instanceof IUnresolvedElement) && $context->getModel()->FindValueTerm($term->FullName()) == null)
27
-        {
26
+        if (!($term instanceof IUnresolvedElement) && $context->getModel()->FindValueTerm($term->FullName()) == null) {
28 27
             $context->AddError(
29 28
                 $annotation->Location(),
30 29
                 EdmErrorCode::BadUnresolvedTerm(),
Please login to merge, or discard this patch.
IValueAnnotation/ValueAnnotationAssertCorrectExpressionType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $errors = null;
25 25
         $term = $annotation->getTerm();
26 26
         assert($term instanceof IValueTerm);
27
-        if (!ExpressionTypeChecker::tryAssertType( $annotation->getValue(),$term->getType(), $errors))
27
+        if (!ExpressionTypeChecker::tryAssertType($annotation->getValue(), $term->getType(), $errors))
28 28
         {
29 29
             foreach ($errors as $error)
30 30
             {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,10 +24,8 @@
 block discarded – undo
24 24
         $errors = null;
25 25
         $term = $annotation->getTerm();
26 26
         assert($term instanceof IValueTerm);
27
-        if (!ExpressionTypeChecker::tryAssertType( $annotation->getValue(),$term->getType(), $errors))
28
-        {
29
-            foreach ($errors as $error)
30
-            {
27
+        if (!ExpressionTypeChecker::tryAssertType( $annotation->getValue(),$term->getType(), $errors)) {
28
+            foreach ($errors as $error) {
31 29
                 $context->AddRawError($error);
32 30
             }
33 31
         }
Please login to merge, or discard this patch.
INavigationProperty/NavigationPropertyDuplicateDependentProperty.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,13 +23,10 @@
 block discarded – undo
23 23
     {
24 24
         assert($navigationProperty instanceof INavigationProperty);
25 25
         $dependentProperties = $navigationProperty->getDependentProperties();
26
-        if ($dependentProperties != null)
27
-        {
26
+        if ($dependentProperties != null) {
28 27
             $propertyNames = new HashSetInternal();
29
-            foreach ($navigationProperty->getDependentProperties() as $property)
30
-            {
31
-                if ($property != null)
32
-                {
28
+            foreach ($navigationProperty->getDependentProperties() as $property) {
29
+                if ($property != null) {
33 30
                     ValidationHelper::AddMemberNameToHashSet(
34 31
                         $property,
35 32
                         $propertyNames,
Please login to merge, or discard this patch.
NavigationPropertyTypeMismatchRelationshipConstraint.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,19 +24,15 @@
 block discarded – undo
24 24
     {
25 25
         assert($navigationProperty instanceof INavigationProperty);
26 26
         $dependentProperties = $navigationProperty->getDependentProperties();
27
-        if ($dependentProperties != null)
28
-        {
27
+        if ($dependentProperties != null) {
29 28
             $dependentPropertiesCount = count($dependentProperties);
30 29
             $principalEntityType = $navigationProperty->getPartner()->DeclaringEntityType();
31 30
             $principalKey = $principalEntityType->Key();
32
-            if ($dependentPropertiesCount == count($principalKey))
33
-            {
34
-                for ($i = 0; $i < $dependentPropertiesCount; $i++)
35
-                {
31
+            if ($dependentPropertiesCount == count($principalKey)) {
32
+                for ($i = 0; $i < $dependentPropertiesCount; $i++) {
36 33
                     if (!EdmElementComparer::isEquivalentTo(
37 34
                         $navigationProperty->getDependentProperties()[$i]->getType()->getDefinition(),
38
-                        $principalKey[$i]->getType()->getDefinition()))
39
-                    {
35
+                        $principalKey[$i]->getType()->getDefinition())) {
40 36
                         $errorMessage = StringConst::EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(
41 37
                             $navigationProperty->getDependentProperties()[$i]->getName(),
42 38
                             $navigationProperty->DeclaringEntityType()->FullName(),
Please login to merge, or discard this patch.
NavigationPropertyInvalidOperationMultipleEndsInAssociation.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 $navigationProperty)
22 22
     {
23 23
         assert($navigationProperty instanceof INavigationProperty);
24
-        if (!$navigationProperty->getOnDelete()->isNone() && !$navigationProperty->getPartner()->getOnDelete()->isNone())
25
-        {
24
+        if (!$navigationProperty->getOnDelete()->isNone() && !$navigationProperty->getPartner()->getOnDelete()->isNone()) {
26 25
             $context->AddError(
27 26
                 $navigationProperty->Location(),
28 27
                 EdmErrorCode::InvalidAction(),
Please login to merge, or discard this patch.
NavigationPropertyInvalidToPropertyInRelationshipConstraintBeforeV2.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
     {
24 24
         assert($navigationProperty instanceof INavigationProperty);
25 25
         $dependentProperties = $navigationProperty->getDependentProperties();
26
-        if ($dependentProperties != null && !ValidationHelper::PropertySetIsSubset($navigationProperty->DeclaringEntityType()->Key(), $dependentProperties))
27
-        {
26
+        if ($dependentProperties != null && !ValidationHelper::PropertySetIsSubset($navigationProperty->DeclaringEntityType()->Key(), $dependentProperties)) {
28 27
             $context->AddError(
29 28
                 $navigationProperty->Location(),
30 29
                 EdmErrorCode::InvalidPropertyInRelationshipConstraint(),
Please login to merge, or discard this patch.