Passed
Pull Request — master (#40)
by Alex
03:15
created
Edm/Validation/ValidationRules/INamedElement/NamedElementNameIsTooLong.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
ValidationRules/IEnumType/EnumTypeEnumMemberNameAlreadyDefined.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,12 +23,10 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Validation/ValidationRules/IEnumType/EnumMustHaveIntegerUnderlyingType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
ValidationRules/IPrimitiveType/PrimitiveTypeMustNotHaveKindOfNone.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
src/Edm/Validation/ValidationRules/IRowType/RowTypeBaseTypeMustBeNull.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
Edm/Validation/ValidationRules/IRowType/RowTypeMustContainProperties.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
IVocabularyAnnotatable/VocabularyAnnotatableNoDuplicateAnnotations.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,8 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
Validation/ValidationRules/IEntityType/EntityTypeEntityKeyMustBeScalar.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,13 +22,10 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
ValidationRules/IEntityType/EntityTypeInvalidKeyKeyDefinedInBaseClass.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.