Passed
Pull Request — master (#40)
by Alex
03:15
created
ValidationRules/IEntityType/EntityTypeKeyPropertyMustBelongToEntity.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         assert($entityType instanceof IEntityType);
25 25
         if ($entityType->getDeclaredKey() != null)
26 26
         {
27
-            foreach ($entityType->getDeclaredKey() as $key )
27
+            foreach ($entityType->getDeclaredKey() as $key)
28 28
                         {
29 29
                             assert($key instanceof IStructuralProperty);
30 30
                             // Key must be one of the declared properties.
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,14 +22,11 @@
 block discarded – undo
22 22
     public function __invoke(ValidationContext $context, ?IEdmElement $entityType)
23 23
     {
24 24
         assert($entityType instanceof IEntityType);
25
-        if ($entityType->getDeclaredKey() != null)
26
-        {
27
-            foreach ($entityType->getDeclaredKey() as $key )
28
-                        {
25
+        if ($entityType->getDeclaredKey() != null) {
26
+            foreach ($entityType->getDeclaredKey() as $key ) {
29 27
                             assert($key instanceof IStructuralProperty);
30 28
                             // Key must be one of the declared properties.
31
-                            if ($key->getDeclaringType() !== $entityType && !$context->checkIsBad($key))
32
-                            {
29
+                            if ($key->getDeclaringType() !== $entityType && !$context->checkIsBad($key)) {
33 30
                                 $context->AddError(
34 31
                                     $entityType->Location(),
35 32
                                     EdmErrorCode::KeyPropertyMustBelongToEntity(),
Please login to merge, or discard this patch.
Validation/ValidationRules/IEntityType/EntityTypeKeyMissingOnEntityType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $entityType)
22 22
     {
23
-        assert( $entityType instanceof IEntityType);
23
+        assert($entityType instanceof IEntityType);
24 24
         if (($entityType->Key() == null || count($entityType->Key()) == 0) && $entityType->getBaseType() === null)
25 25
         {
26 26
             $context->AddError(
Please login to merge, or discard this 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 $entityType)
22 22
     {
23 23
         assert( $entityType instanceof IEntityType);
24
-        if (($entityType->Key() == null || count($entityType->Key()) == 0) && $entityType->getBaseType() === null)
25
-        {
24
+        if (($entityType->Key() == null || count($entityType->Key()) == 0) && $entityType->getBaseType() === null) {
26 25
             $context->AddError(
27 26
                 $entityType->Location(),
28 27
                 EdmErrorCode::KeyMissingOnEntityType(),
Please login to merge, or discard this patch.
ValidationRules/IEntityType/EntityTypeEntityKeyMustNotBeBinaryBeforeV2.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         assert($entityType instanceof IEntityType);
24 24
         if ($entityType->Key() != null)
25 25
         {
26
-            foreach ( $entityType->Key() as $key)
26
+            foreach ($entityType->Key() as $key)
27 27
                         {
28 28
                             assert($key instanceof IStructuralProperty);
29 29
                             if ($key->getType()->IsBinary() && !$context->checkIsBad($key->getType()->getDefinition()))
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,13 +21,10 @@
 block discarded – undo
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $entityType)
22 22
     {
23 23
         assert($entityType instanceof IEntityType);
24
-        if ($entityType->Key() != null)
25
-        {
26
-            foreach ( $entityType->Key() as $key)
27
-                        {
24
+        if ($entityType->Key() != null) {
25
+            foreach ( $entityType->Key() as $key) {
28 26
                             assert($key instanceof IStructuralProperty);
29
-                            if ($key->getType()->IsBinary() && !$context->checkIsBad($key->getType()->getDefinition()))
30
-                            {
27
+                            if ($key->getType()->IsBinary() && !$context->checkIsBad($key->getType()->getDefinition())) {
31 28
                                 $context->AddError(
32 29
                                     $key->Location(),
33 30
                                     EdmErrorCode::EntityKeyMustNotBeBinary(),
Please login to merge, or discard this patch.
IEntityType/EntityTypeDuplicatePropertyNameSpecifiedInEntityKey.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,11 +24,9 @@
 block discarded – undo
24 24
     public function __invoke(ValidationContext $context, ?IEdmElement $entityType)
25 25
     {
26 26
         assert($entityType instanceof IEntityType);
27
-        if ($entityType->getDeclaredKey() != null)
28
-        {
27
+        if ($entityType->getDeclaredKey() != null) {
29 28
             $keyPropertyNameList = new HashSetInternal();
30
-            foreach ($entityType->getDeclaredKey() as $item)
31
-            {
29
+            foreach ($entityType->getDeclaredKey() as $item) {
32 30
                 ValidationHelper::AddMemberNameToHashSet(
33 31
                     $item,
34 32
                     $keyPropertyNameList,
Please login to merge, or discard this patch.
ITemporalTypeReference/TemporalTypeReferencePrecisionOutOfRange.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 $type)
23 23
     {
24 24
         assert($type instanceof ITemporalTypeReference);
25
-        if ($type->getPrecision() > EdmConstants::Max_Precision || $type->getPrecision() < EdmConstants::Min_Precision)
26
-        {
25
+        if ($type->getPrecision() > EdmConstants::Max_Precision || $type->getPrecision() < EdmConstants::Min_Precision) {
27 26
             $context->AddError(
28 27
                 $type->Location(),
29 28
                 EdmErrorCode::PrecisionOutOfRange(),
Please login to merge, or discard this patch.
ValidationRules/ISchemaElement/SchemaElementNamespaceIsNotAllowed.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,8 @@
 block discarded – undo
28 28
             strlen($item->getNamespace()) <= CsdlConstants::Max_NamespaceLength &&
29 29
             strlen($item->getNamespace()) > 0 &&
30 30
             !EdmUtil::IsNullOrWhiteSpaceInternal($item->getNamespace())
31
-        )
32
-        {
33
-            if (!EdmUtil::IsValidDottedName($item->getNamespace()))
34
-            {
31
+        ) {
32
+            if (!EdmUtil::IsValidDottedName($item->getNamespace())) {
35 33
                 $context->AddError(
36 34
                     $item->Location(),
37 35
                     EdmErrorCode::InvalidNamespaceName(),
Please login to merge, or discard this patch.
ValidationRules/ISchemaElement/SchemaElementMustNotHaveKindOfNone.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 $element)
22 22
     {
23 23
         assert($element instanceof ISchemaElement);
24
-        if ($element->getSchemaElementKind()->isNone() && !$context->checkIsBad($element))
25
-        {
24
+        if ($element->getSchemaElementKind()->isNone() && !$context->checkIsBad($element)) {
26 25
             $context->AddError(
27 26
                 $element->Location(),
28 27
                 EdmErrorCode::SchemaElementMustNotHaveKindOfNone(),
Please login to merge, or discard this patch.
ISchemaElement/SchemaElementNamespaceMustNotBeEmptyOrWhiteSpace.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 ISchemaElement);
25
-        if (EdmUtil::IsNullOrWhiteSpaceInternal($item->getNamespace()) || strlen($item->getNamespace()) === 0)
26
-        {
25
+        if (EdmUtil::IsNullOrWhiteSpaceInternal($item->getNamespace()) || strlen($item->getNamespace()) === 0) {
27 26
             $context->AddError(
28 27
                 $item->Location(),
29 28
                 EdmErrorCode::InvalidNamespaceName(),
Please login to merge, or discard this patch.
ValidationRules/ISchemaElement/SchemaElementSystemNamespaceEncountered.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 $element)
23 23
     {
24 24
         assert($element instanceof ISchemaElement);
25
-        if (ValidationHelper::IsEdmSystemNamespace($element->getNamespace()))
26
-        {
25
+        if (ValidationHelper::IsEdmSystemNamespace($element->getNamespace())) {
27 26
             $context->AddError(
28 27
                 $element->Location(),
29 28
                 EdmErrorCode::SystemNamespaceEncountered(),
Please login to merge, or discard this patch.