@@ -19,12 +19,10 @@ |
||
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 | } |
@@ -11,6 +11,6 @@ |
||
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 |
@@ -20,8 +20,7 @@ |
||
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 | } |
@@ -23,8 +23,7 @@ |
||
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(), |
@@ -24,7 +24,7 @@ |
||
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 | { |
@@ -24,10 +24,8 @@ |
||
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 | } |
@@ -23,13 +23,10 @@ |
||
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, |
@@ -24,19 +24,15 @@ |
||
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(), |
@@ -21,8 +21,7 @@ |
||
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(), |
@@ -23,8 +23,7 @@ |
||
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(), |