@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $property) |
22 | 22 | { |
23 | 23 | assert($property instanceof IStructuralProperty); |
24 | - if ($property->getDeclaringType()->getTypeKind()->isRow()) |
|
25 | - { |
|
24 | + if ($property->getDeclaringType()->getTypeKind()->isRow()) { |
|
26 | 25 | $validatedType = $property->getType()->IsCollection() ? |
27 | 26 | $property->getType()->AsCollection()->ElementType()->getDefinition() |
28 | 27 | : |
@@ -31,8 +30,7 @@ discard block |
||
31 | 30 | if (!$validatedType->getTypeKind()->isPrimitive() && |
32 | 31 | !$validatedType->getTypeKind()->isEnum() && |
33 | 32 | !$validatedType->getTypeKind()->isComplex() && |
34 | - !$context->checkIsBad($validatedType)) |
|
35 | - { |
|
33 | + !$context->checkIsBad($validatedType)) { |
|
36 | 34 | $context->AddError( |
37 | 35 | $property->Location(), |
38 | 36 | EdmErrorCode::InvalidPropertyType(), |
@@ -32,8 +32,7 @@ |
||
32 | 32 | StringConst::EdmModel_Validator_Semantic_InvalidPropertyTypeConcurrencyMode( |
33 | 33 | ( |
34 | 34 | $property->getType()->IsCollection() ? |
35 | - EdmConstants::Type_Collection : |
|
36 | - $property->getType()->TypeKind()->getKey() |
|
35 | + EdmConstants::Type_Collection : $property->getType()->TypeKind()->getKey() |
|
37 | 36 | ) |
38 | 37 | ) |
39 | 38 | ); |
@@ -24,8 +24,7 @@ |
||
24 | 24 | assert($property instanceof IStructuralProperty); |
25 | 25 | if ($property->getConcurrencyMode()->isFixed() && |
26 | 26 | !$property->getType()->IsPrimitive() && |
27 | - !$context->checkIsBad($property->getType()->getDefinition())) |
|
28 | - { |
|
27 | + !$context->checkIsBad($property->getType()->getDefinition())) { |
|
29 | 28 | $context->AddError( |
30 | 29 | $property->Location(), |
31 | 30 | EdmErrorCode::InvalidPropertyType(), |
@@ -20,7 +20,7 @@ |
||
20 | 20 | } |
21 | 21 | else |
22 | 22 | { |
23 | - return [InterfaceValidator::CreatePropertyMustNotBeNullError($annotation, "Value") ]; |
|
23 | + return [InterfaceValidator::CreatePropertyMustNotBeNullError($annotation, "Value")]; |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -13,13 +13,10 @@ |
||
13 | 13 | protected function VisitT($annotation, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($annotation instanceof IValueAnnotation); |
16 | - if ($annotation->getValue() != null) |
|
17 | - { |
|
16 | + if ($annotation->getValue() != null) { |
|
18 | 17 | $followup[] = $annotation->getValue(); |
19 | 18 | return null; |
20 | - } |
|
21 | - else |
|
22 | - { |
|
19 | + } else { |
|
23 | 20 | return [InterfaceValidator::CreatePropertyMustNotBeNullError($annotation, "Value") ]; |
24 | 21 | } |
25 | 22 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | protected function VisitT($item, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($item instanceof INamedElement); |
16 | - return $item->getName() != null ? null : [ InterfaceValidator::CreatePropertyMustNotBeNullError($item, "Name") ]; |
|
16 | + return $item->getName() != null ? null : [InterfaceValidator::CreatePropertyMustNotBeNullError($item, "Name")]; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function forType(): string |
@@ -13,13 +13,10 @@ |
||
13 | 13 | protected function VisitT($expression, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($expression instanceof ILabeledExpressionReferenceExpression); |
16 | - if ($expression->getReferencedLabeledExpression() != null) |
|
17 | - { |
|
16 | + if ($expression->getReferencedLabeledExpression() != null) { |
|
18 | 17 | $references[] = $expression->getReferencedLabeledExpression(); |
19 | 18 | return null; |
20 | - } |
|
21 | - else |
|
22 | - { |
|
19 | + } else { |
|
23 | 20 | return [ |
24 | 21 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
25 | 22 | $expression, |
@@ -16,7 +16,7 @@ |
||
16 | 16 | assert($typeRef instanceof IBinaryTypeReference); |
17 | 17 | $primitive = $typeRef->getDefinition(); |
18 | 18 | assert($primitive instanceof IPrimitiveType); |
19 | - return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->isBinary() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
19 | + return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->isBinary() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function forType(): string |
@@ -17,7 +17,7 @@ |
||
17 | 17 | assert($typeRef instanceof IStringTypeReference); |
18 | 18 | $primitive = $typeRef->getDefinition(); |
19 | 19 | assert($primitive instanceof IPrimitiveType); |
20 | - return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->isString() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
20 | + return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->isString() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function forType(): string |
@@ -13,13 +13,10 @@ |
||
13 | 13 | protected function VisitT($value, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($value instanceof IEnumValue); |
16 | - if ($value->getValue() != null) |
|
17 | - { |
|
16 | + if ($value->getValue() != null) { |
|
18 | 17 | $followup[] = $value->getValue(); |
19 | 18 | return null; |
20 | - } |
|
21 | - else |
|
22 | - { |
|
19 | + } else { |
|
23 | 20 | return [InterfaceValidator::CreatePropertyMustNotBeNullError($value, "Value")]; |
24 | 21 | } |
25 | 22 | } |
@@ -17,8 +17,7 @@ |
||
17 | 17 | |
18 | 18 | InterfaceValidator::ProcessEnumerable($expression, $expression->getElements(), "Elements", $followup, $errors); |
19 | 19 | |
20 | - if ($expression->getDeclaredType() != null) |
|
21 | - { |
|
20 | + if ($expression->getDeclaredType() != null) { |
|
22 | 21 | // Collection constructor owns its type reference, so it goes as a followup. |
23 | 22 | $followup[] = $expression->getDeclaredType(); |
24 | 23 | } |