Passed
Pull Request — master (#40)
by Alex
03:15
created
IStructuredType/StructuredTypeInvalidMemberNameMatchesTypeName.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
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
                 {
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,15 +26,11 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
IStructuredType/StructuredTypeBaseTypeMustBeSameKindAsDerivedKind.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,13 +23,11 @@
 block discarded – undo
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
                     (
Please login to merge, or discard this patch.
IStructuredType/StructuredTypePropertiesDeclaringTypeMustBeCorrect.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,12 +21,9 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
Edm/Validation/ValidationRules/IProperty/PropertyMustNotHaveKindOfNone.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
IPropertyValueBinding/PropertyValueBindingValueIsCorrectType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
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
         )
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,10 +25,8 @@
 block discarded – undo
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
         }    }
Please login to merge, or discard this patch.
IPrimitiveTypeReference/SpatialTypeReferencesNotSupportedBeforeV3.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
IPrimitiveTypeReference/StreamTypeReferencesNotSupportedBeforeV3.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
ValidationRules/IComplexType/ComplexTypeMustContainProperties.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 $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(),
Please login to merge, or discard this patch.
ValidationRules/IComplexType/ComplexTypeInvalidPolymorphicComplexType.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 $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(),
Please login to merge, or discard this patch.