@@ -16,7 +16,7 @@ |
||
16 | 16 | assert($typeRef instanceof IDecimalTypeReference); |
17 | 17 | $primitive = $typeRef->getDefinition(); |
18 | 18 | assert($primitive instanceof IPrimitiveType); |
19 | - return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->isDecimal() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
19 | + return $typeRef->getDefinition() != null && !$primitive->getPrimitiveKind()->isDecimal() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function forType(): string |
@@ -20,8 +20,7 @@ |
||
20 | 20 | // Return type is optional for function imports and is required for MDFs. Both cases are derived interfaces (IEdmFunctionImport and IEdmFunction). |
21 | 21 | // So, from the point of view of this interface, we consider return type as optional and it is expected that IEdmFunction visitor will have |
22 | 22 | // an additional null check for the return type. |
23 | - if ($function->getReturnType() != null) |
|
24 | - { |
|
23 | + if ($function->getReturnType() != null) { |
|
25 | 24 | // Function owns its return type reference, so it goes as a followup. |
26 | 25 | $followup[] = $function->getReturnType(); |
27 | 26 | } |
@@ -16,12 +16,9 @@ discard block |
||
16 | 16 | assert($item instanceof IEntitySet); |
17 | 17 | $errors = null; |
18 | 18 | |
19 | - if ($item->getElementType() != null) |
|
20 | - { |
|
19 | + if ($item->getElementType() != null) { |
|
21 | 20 | $references[] = $item->getElementType(); |
22 | - } |
|
23 | - else |
|
24 | - { |
|
21 | + } else { |
|
25 | 22 | InterfaceValidator::CollectErrors( |
26 | 23 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
27 | 24 | $item, |
@@ -41,14 +38,10 @@ discard block |
||
41 | 38 | /** |
42 | 39 | * @var INavigationTargetMapping $navTargetMapping |
43 | 40 | */ |
44 | - foreach ($navTargetMappings as $navTargetMapping) |
|
45 | - { |
|
46 | - if ($navTargetMapping->getNavigationProperty() != null) |
|
47 | - { |
|
41 | + foreach ($navTargetMappings as $navTargetMapping) { |
|
42 | + if ($navTargetMapping->getNavigationProperty() != null) { |
|
48 | 43 | $references[] = $navTargetMapping->getNavigationProperty(); |
49 | - } |
|
50 | - else |
|
51 | - { |
|
44 | + } else { |
|
52 | 45 | InterfaceValidator::CollectErrors( |
53 | 46 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
54 | 47 | $navTargetMapping, |
@@ -57,12 +50,9 @@ discard block |
||
57 | 50 | $errors); |
58 | 51 | } |
59 | 52 | |
60 | - if ($navTargetMapping->getTargetEntitySet() != null) |
|
61 | - { |
|
53 | + if ($navTargetMapping->getTargetEntitySet() != null) { |
|
62 | 54 | $references[] = $navTargetMapping->getTargetEntitySet(); |
63 | - } |
|
64 | - else |
|
65 | - { |
|
55 | + } else { |
|
66 | 56 | InterfaceValidator::CollectErrors( |
67 | 57 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
68 | 58 | $navTargetMapping, |
@@ -12,7 +12,7 @@ |
||
12 | 12 | protected function VisitT($typeRef, array &$followup, array &$references): iterable |
13 | 13 | { |
14 | 14 | assert($typeRef instanceof IPrimitiveTypeReference); |
15 | - return $typeRef->getDefinition() != null && !$typeRef->getDefinition()->getTypeKind()->isPrimitive() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
15 | + return $typeRef->getDefinition() != null && !$typeRef->getDefinition()->getTypeKind()->isPrimitive() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function forType(): string |
@@ -15,12 +15,9 @@ discard block |
||
15 | 15 | assert($expression instanceof IValueTermReferenceExpression); |
16 | 16 | $errors = null; |
17 | 17 | |
18 | - if ($expression->getBase() != null) |
|
19 | - { |
|
18 | + if ($expression->getBase() != null) { |
|
20 | 19 | $followup[] = $expression->getBase(); |
21 | - } |
|
22 | - else |
|
23 | - { |
|
20 | + } else { |
|
24 | 21 | InterfaceValidator::CollectErrors( |
25 | 22 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
26 | 23 | $expression, |
@@ -30,12 +27,9 @@ discard block |
||
30 | 27 | ); |
31 | 28 | } |
32 | 29 | |
33 | - if ($expression->getTerm() != null) |
|
34 | - { |
|
30 | + if ($expression->getTerm() != null) { |
|
35 | 31 | $references[] = $expression->getTerm(); |
36 | - } |
|
37 | - else |
|
38 | - { |
|
32 | + } else { |
|
39 | 33 | InterfaceValidator::CollectErrors( |
40 | 34 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
41 | 35 | $expression, |
@@ -17,13 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | $errors = null; |
19 | 19 | |
20 | - if ($parameter->getType() != null) |
|
21 | - { |
|
20 | + if ($parameter->getType() != null) { |
|
22 | 21 | // Parameter owns its type reference, so it goes as a followup. |
23 | 22 | $followup[] = $parameter->getType(); |
24 | - } |
|
25 | - else |
|
26 | - { |
|
23 | + } else { |
|
27 | 24 | InterfaceValidator::CollectErrors( |
28 | 25 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
29 | 26 | $parameter, "Type" |
@@ -32,12 +29,9 @@ discard block |
||
32 | 29 | ); |
33 | 30 | } |
34 | 31 | |
35 | - if ($parameter->getDeclaringFunction() != null) |
|
36 | - { |
|
32 | + if ($parameter->getDeclaringFunction() != null) { |
|
37 | 33 | $references[] = $parameter->getDeclaringFunction(); |
38 | - } |
|
39 | - else |
|
40 | - { |
|
34 | + } else { |
|
41 | 35 | InterfaceValidator::CollectErrors( |
42 | 36 | InterfaceValidator::CreatePropertyMustNotBeNullError( |
43 | 37 | $parameter, |
@@ -48,8 +42,7 @@ discard block |
||
48 | 42 | } |
49 | 43 | |
50 | 44 | if ($parameter->getMode()->getValue() < FunctionParameterMode::None()->getValue() || |
51 | - $parameter->getMode()->getValue() > FunctionParameterMode::InOut()->getValue()) |
|
52 | - { |
|
45 | + $parameter->getMode()->getValue() > FunctionParameterMode::InOut()->getValue()) { |
|
53 | 46 | InterfaceValidator::CollectErrors( |
54 | 47 | InterfaceValidator::CreateEnumPropertyOutOfRangeError( |
55 | 48 | $parameter, |
@@ -14,8 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | assert($type instanceof IEntityType); |
16 | 16 | $errors = null; |
17 | - if ($type->getDeclaredKey() != null) |
|
18 | - { |
|
17 | + if ($type->getDeclaredKey() != null) { |
|
19 | 18 | InterfaceValidator::ProcessEnumerable($type, $type->getDeclaredKey(), "DeclaredKey", $references, $errors); |
20 | 19 | } |
21 | 20 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | } |
21 | 21 | else |
22 | 22 | { |
23 | - return [ InterfaceValidator::CreatePropertyMustNotBeNullError($type, "EntityType") ]; |
|
23 | + return [InterfaceValidator::CreatePropertyMustNotBeNullError($type, "EntityType")]; |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -13,13 +13,10 @@ |
||
13 | 13 | protected function VisitT($type, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($type instanceof IEntityReferenceType); |
16 | - if ($type->getEntityType() != null) |
|
17 | - { |
|
16 | + if ($type->getEntityType() != null) { |
|
18 | 17 | $references[] = $type->getEntityType(); |
19 | 18 | return null; |
20 | - } |
|
21 | - else |
|
22 | - { |
|
19 | + } else { |
|
23 | 20 | return [ InterfaceValidator::CreatePropertyMustNotBeNullError($type, "EntityType") ]; |
24 | 21 | } |
25 | 22 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | protected function VisitT($typeRef, array &$followup, array &$references): iterable |
14 | 14 | { |
15 | 15 | assert($typeRef instanceof IStructuredTypeReference); |
16 | - return $typeRef->getDefinition() != null && !$typeRef->getDefinition()->getTypeKind()->IsStructured() ? [ InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef) ] : null; |
|
16 | + return $typeRef->getDefinition() != null && !$typeRef->getDefinition()->getTypeKind()->IsStructured() ? [InterfaceValidator::CreateTypeRefInterfaceTypeKindValueMismatchError($typeRef)] : null; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function forType(): string |