@@ -26,7 +26,7 @@ |
||
26 | 26 | !$context->checkIsBad($expression->getDeclaredType())) |
27 | 27 | { |
28 | 28 | $discoveredErrors = null; |
29 | - ExpressionTypeChecker::TryAssertRecordAsType($expression, $expression->getDeclaredType(), null, false, $discoveredErrors); |
|
29 | + ExpressionTypeChecker::TryAssertRecordAsType($expression, $expression->getDeclaredType(), null, false, $discoveredErrors); |
|
30 | 30 | foreach ($discoveredErrors as $error) |
31 | 31 | { |
32 | 32 | $context->AddRawError($error); |
@@ -23,12 +23,10 @@ |
||
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 | } |
@@ -21,8 +21,7 @@ discard block |
||
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 |
||
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(), |
@@ -22,13 +22,11 @@ |
||
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(), |
@@ -19,10 +19,8 @@ |
||
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( |
@@ -19,8 +19,7 @@ |
||
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 | } |
@@ -22,8 +22,7 @@ discard block |
||
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 |
||
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(), |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $containmentFound = false; |
24 | 24 | foreach ($set->getContainer()->EntitySets() as $otherSet) |
25 | 25 | { |
26 | - foreach ( $otherSet->getNavigationTargets() as $mapping) |
|
26 | + foreach ($otherSet->getNavigationTargets() as $mapping) |
|
27 | 27 | { |
28 | 28 | $property = $mapping->getNavigationProperty(); |
29 | 29 |
@@ -21,16 +21,12 @@ |
||
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(), |
@@ -26,8 +26,7 @@ |
||
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(), |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $annotation->Location(), |
30 | 30 | EdmErrorCode::DuplicateDirectValueAnnotationFullName(), |
31 | 31 | StringConst::EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique($annotation->getNamespaceUri(), $annotation->getName())); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | $annotationNameSet[] = $annotation->getNamespaceUri() . ':' . $annotation->getName(); |
34 | 34 | } |
35 | 35 | } |
@@ -20,16 +20,14 @@ |
||
20 | 20 | public function __invoke(ValidationContext $context, ?IEdmElement $item) |
21 | 21 | { |
22 | 22 | $annotationNameSet = []; |
23 | - foreach ($context->getModel()->getDirectValueAnnotationsManager()->getDirectValueAnnotations($item) as $annotation) |
|
24 | - { |
|
23 | + foreach ($context->getModel()->getDirectValueAnnotationsManager()->getDirectValueAnnotations($item) as $annotation) { |
|
25 | 24 | assert($annotation instanceof IDirectValueAnnotation); |
26 | - if (in_array($annotation->getNamespaceUri() . ':' . $annotation->getName(), $annotationNameSet)) |
|
27 | - { |
|
25 | + if (in_array($annotation->getNamespaceUri() . ':' . $annotation->getName(), $annotationNameSet)) { |
|
28 | 26 | $context->AddError( |
29 | 27 | $annotation->Location(), |
30 | 28 | EdmErrorCode::DuplicateDirectValueAnnotationFullName(), |
31 | 29 | StringConst::EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique($annotation->getNamespaceUri(), $annotation->getName())); |
32 | - }else{ |
|
30 | + } else { |
|
33 | 31 | $annotationNameSet[] = $annotation->getNamespaceUri() . ':' . $annotation->getName(); |
34 | 32 | } |
35 | 33 | } |