@@ -22,8 +22,7 @@ |
||
22 | 22 | public function __invoke(ValidationContext $context, ?IEdmElement $item) |
23 | 23 | { |
24 | 24 | assert($item instanceof INamedElement); |
25 | - if (!EdmUtil::IsNullOrWhiteSpaceInternal($item->getName()) && strlen($item->getName()) > CsdlConstants::Max_NameLength) |
|
26 | - { |
|
25 | + if (!EdmUtil::IsNullOrWhiteSpaceInternal($item->getName()) && strlen($item->getName()) > CsdlConstants::Max_NameLength) { |
|
27 | 26 | $context->AddError( |
28 | 27 | $item->Location(), |
29 | 28 | EdmErrorCode::NameTooLong(), |
@@ -23,12 +23,10 @@ |
||
23 | 23 | { |
24 | 24 | assert($enumType instanceof IEnumType); |
25 | 25 | $memberNames = new HashSetInternal(); |
26 | - foreach ($enumType->getMembers() as $member) |
|
27 | - { |
|
26 | + foreach ($enumType->getMembers() as $member) { |
|
28 | 27 | // We only want to report the properties that are declared in this type. Otherwise properties will get |
29 | 28 | // reported multiple times due to inheritance. |
30 | - if ($member != null) |
|
31 | - { |
|
29 | + if ($member != null) { |
|
32 | 30 | ValidationHelper::AddMemberNameToHashSet( |
33 | 31 | $member, |
34 | 32 | $memberNames, |
@@ -21,8 +21,7 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $enumType) |
22 | 22 | { |
23 | 23 | assert($enumType instanceof IEnumType); |
24 | - if (!$enumType->getUnderlyingType()->getPrimitiveKind()->isIntegral() && !$context->checkIsBad($enumType->getUnderlyingType())) |
|
25 | - { |
|
24 | + if (!$enumType->getUnderlyingType()->getPrimitiveKind()->isIntegral() && !$context->checkIsBad($enumType->getUnderlyingType())) { |
|
26 | 25 | $context->AddError( |
27 | 26 | $enumType->Location(), |
28 | 27 | EdmErrorCode::EnumMustHaveIntegerUnderlyingType(), |
@@ -21,8 +21,7 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $type) |
22 | 22 | { |
23 | 23 | assert($type instanceof IPrimitiveType); |
24 | - if ($type->getPrimitiveKind()->isNone() && !$context->checkIsBad($type)) |
|
25 | - { |
|
24 | + if ($type->getPrimitiveKind()->isNone() && !$context->checkIsBad($type)) { |
|
26 | 25 | $context->AddError( |
27 | 26 | $type->Location(), |
28 | 27 | EdmErrorCode::PrimitiveTypeMustNotHaveKindOfNone(), |
@@ -21,8 +21,7 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $rowType) |
22 | 22 | { |
23 | 23 | assert($rowType instanceof IRowType); |
24 | - if ($rowType->getBaseType() != null) |
|
25 | - { |
|
24 | + if ($rowType->getBaseType() != null) { |
|
26 | 25 | $context->AddError( |
27 | 26 | $rowType->Location(), |
28 | 27 | EdmErrorCode::RowTypeMustNotHaveBaseType(), |
@@ -21,8 +21,7 @@ |
||
21 | 21 | public function __invoke(ValidationContext $context, ?IEdmElement $rowType) |
22 | 22 | { |
23 | 23 | assert($rowType instanceof IRowType); |
24 | - if (count($rowType->Properties()) === 0) |
|
25 | - { |
|
24 | + if (count($rowType->Properties()) === 0) { |
|
26 | 25 | $context->AddError( |
27 | 26 | $rowType->Location(), |
28 | 27 | EdmErrorCode::RowTypeMustHaveProperties(), |
@@ -22,10 +22,8 @@ |
||
22 | 22 | { |
23 | 23 | assert($annotatable instanceof IVocabularyAnnotatable); |
24 | 24 | $annotationSet = new HashSetInternal(); |
25 | - foreach ($annotatable->VocabularyAnnotations($context->getModel()) as $annotation) |
|
26 | - { |
|
27 | - if (!$annotationSet->add($annotation->getTerm()->FullName() . ":" . $annotation->getQualifier())) |
|
28 | - { |
|
25 | + foreach ($annotatable->VocabularyAnnotations($context->getModel()) as $annotation) { |
|
26 | + if (!$annotationSet->add($annotation->getTerm()->FullName() . ":" . $annotation->getQualifier())) { |
|
29 | 27 | $context->AddError( |
30 | 28 | $annotation->Location(), |
31 | 29 | EdmErrorCode::DuplicateAnnotation(), |
@@ -22,13 +22,10 @@ |
||
22 | 22 | public function __invoke(ValidationContext $context, ?IEdmElement $entityType) |
23 | 23 | { |
24 | 24 | assert($entityType instanceof IEntityType); |
25 | - if ($entityType->Key() != null) |
|
26 | - { |
|
27 | - foreach ($entityType->Key() as $key) |
|
28 | - { |
|
25 | + if ($entityType->Key() != null) { |
|
26 | + foreach ($entityType->Key() as $key) { |
|
29 | 27 | assert($key instanceof IStructuralProperty); |
30 | - if (!$key->getType()->IsPrimitive() && !$context->checkIsBad($key)) |
|
31 | - { |
|
28 | + if (!$key->getType()->IsPrimitive() && !$context->checkIsBad($key)) { |
|
32 | 29 | $context->AddError( |
33 | 30 | $key->Location(), |
34 | 31 | EdmErrorCode::EntityKeyMustBeScalar(), |
@@ -24,8 +24,7 @@ |
||
24 | 24 | if ($entityType->getBaseType() != null && |
25 | 25 | $entityType->getDeclaredKey() != null && |
26 | 26 | $entityType->getBaseType()->getTypeKind()->isEntity() && |
27 | - $entityType->BaseEntityType()->getDeclaredKey() != null) |
|
28 | - { |
|
27 | + $entityType->BaseEntityType()->getDeclaredKey() != null) { |
|
29 | 28 | $context->AddError( |
30 | 29 | $entityType->Location(), |
31 | 30 | EdmErrorCode::InvalidKey(), |