@@ -28,7 +28,7 @@ |
||
28 | 28 | $properties = $structuredType->Properties(); |
29 | 29 | if (count($properties) > 0) |
30 | 30 | { |
31 | - foreach ($properties as $property ) |
|
31 | + foreach ($properties as $property) |
|
32 | 32 | { |
33 | 33 | if ($property != null) |
34 | 34 | { |
@@ -26,15 +26,11 @@ |
||
26 | 26 | assert($schemaType instanceof ISchemaType); |
27 | 27 | |
28 | 28 | $properties = $structuredType->Properties(); |
29 | - if (count($properties) > 0) |
|
30 | - { |
|
31 | - foreach ($properties as $property ) |
|
32 | - { |
|
33 | - if ($property != null) |
|
34 | - { |
|
29 | + if (count($properties) > 0) { |
|
30 | + foreach ($properties as $property ) { |
|
31 | + if ($property != null) { |
|
35 | 32 | assert($property instanceof IProperty); |
36 | - if ($property->getName() === $schemaType->getName()) |
|
37 | - { |
|
33 | + if ($property->getName() === $schemaType->getName()) { |
|
38 | 34 | $context->AddError( |
39 | 35 | $property->Location(), |
40 | 36 | EdmErrorCode::BadProperty(), |
@@ -23,13 +23,11 @@ |
||
23 | 23 | { |
24 | 24 | assert($structuredType instanceof IStructuredType); |
25 | 25 | // We can either have 2 rules (entity and complex) or have one rule and exclude row type. I'm choosing the latter. |
26 | - if ($structuredType instanceof ISchemaType) |
|
27 | - { |
|
26 | + if ($structuredType instanceof ISchemaType) { |
|
28 | 27 | if ( |
29 | 28 | $structuredType->getBaseType() != null && |
30 | 29 | $structuredType->getBaseType()->getTypeKind() !== $structuredType->getTypeKind() |
31 | - ) |
|
32 | - { |
|
30 | + ) { |
|
33 | 31 | $context->AddError( |
34 | 32 | $structuredType->Location(), |
35 | 33 | ( |
@@ -21,12 +21,9 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $structuredType) |
22 | 22 | { |
23 | 23 | assert($structuredType instanceof IStructuredType); |
24 | - foreach ($structuredType->getDeclaredProperties() as $property) |
|
25 | - { |
|
26 | - if ($property != null) |
|
27 | - { |
|
28 | - if ($property->getDeclaringType() !== $structuredType) |
|
29 | - { |
|
24 | + foreach ($structuredType->getDeclaredProperties() as $property) { |
|
25 | + if ($property != null) { |
|
26 | + if ($property->getDeclaringType() !== $structuredType) { |
|
30 | 27 | $context->AddError( |
31 | 28 | $property->Location(), |
32 | 29 | EdmErrorCode::DeclaringTypeMustBeCorrect(), |
@@ -20,8 +20,7 @@ |
||
20 | 20 | public function __invoke(ValidationContext $context, ?IEdmElement $property) |
21 | 21 | { |
22 | 22 | assert($property instanceof IProperty); |
23 | - if ($property->getPropertyKind()->isNone() && !$context->checkIsBad($property)) |
|
24 | - { |
|
23 | + if ($property->getPropertyKind()->isNone() && !$context->checkIsBad($property)) { |
|
25 | 24 | $context->AddError( |
26 | 25 | $property->Location(), |
27 | 26 | EdmErrorCode::PropertyMustNotHaveKindOfNone(), |
@@ -22,7 +22,7 @@ |
||
22 | 22 | assert($binding instanceof IPropertyValueBinding); |
23 | 23 | $errors = null; |
24 | 24 | if ( |
25 | - !ExpressionTypeChecker::tryAssertType( $binding->getValue(), $binding->getBoundProperty()->getType(), $errors) && |
|
25 | + !ExpressionTypeChecker::tryAssertType($binding->getValue(), $binding->getBoundProperty()->getType(), $errors) && |
|
26 | 26 | !$context->checkIsBad($binding) && |
27 | 27 | !$context->checkIsBad($binding->getBoundProperty()) |
28 | 28 | ) |
@@ -25,10 +25,8 @@ |
||
25 | 25 | !ExpressionTypeChecker::tryAssertType( $binding->getValue(), $binding->getBoundProperty()->getType(), $errors) && |
26 | 26 | !$context->checkIsBad($binding) && |
27 | 27 | !$context->checkIsBad($binding->getBoundProperty()) |
28 | - ) |
|
29 | - { |
|
30 | - foreach ($errors as $error) |
|
31 | - { |
|
28 | + ) { |
|
29 | + foreach ($errors as $error) { |
|
32 | 30 | $context->AddRawError($error); |
33 | 31 | } |
34 | 32 | } } |
@@ -20,8 +20,7 @@ |
||
20 | 20 | public function __invoke(ValidationContext $context, ?IEdmElement $type) |
21 | 21 | { |
22 | 22 | assert($type instanceof IPrimitiveTypeReference); |
23 | - if ($type->IsSpatial()) |
|
24 | - { |
|
23 | + if ($type->IsSpatial()) { |
|
25 | 24 | $context->AddError( |
26 | 25 | $type->Location(), |
27 | 26 | EdmErrorCode::SpatialTypeReferencesNotSupportedBeforeV3(), |
@@ -20,8 +20,7 @@ |
||
20 | 20 | public function __invoke(ValidationContext $context, ?IEdmElement $type) |
21 | 21 | { |
22 | 22 | assert($type instanceof IPrimitiveTypeReference); |
23 | - if ($type->IsStream()) |
|
24 | - { |
|
23 | + if ($type->IsStream()) { |
|
25 | 24 | $context->AddError( |
26 | 25 | $type->Location(), |
27 | 26 | EdmErrorCode::StreamTypeReferencesNotSupportedBeforeV3(), |
@@ -21,8 +21,7 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $complexType) |
22 | 22 | { |
23 | 23 | assert($complexType instanceof IComplexType); |
24 | - if (!(count($complexType->Properties()) == 0)) |
|
25 | - { |
|
24 | + if (!(count($complexType->Properties()) == 0)) { |
|
26 | 25 | $context->AddError( |
27 | 26 | $complexType->Location(), |
28 | 27 | EdmErrorCode::ComplexTypeMustHaveProperties(), |
@@ -21,8 +21,7 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $edmComplexType) |
22 | 22 | { |
23 | 23 | assert($edmComplexType instanceof IComplexType); |
24 | - if ($edmComplexType->getBaseType() != null) |
|
25 | - { |
|
24 | + if ($edmComplexType->getBaseType() != null) { |
|
26 | 25 | $context->AddError( |
27 | 26 | $edmComplexType->Location(), |
28 | 27 | EdmErrorCode::InvalidPolymorphicComplexType(), |