Passed
Pull Request — master (#66)
by Alex
03:07
created
src/Asserts.php 1 patch
Spacing   +7 added lines, -13 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             );
37 37
         };
38 38
         assert(
39
-            $expectedReflection->getNumberOfRequiredParameters() ===  $actualReflection->getNumberOfRequiredParameters(),
39
+            $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(),
40 40
             $messageBuilder('Incorrect Parameter Count')
41 41
         );
42 42
         if ($expectedReflection->hasReturnType()) {
@@ -48,11 +48,9 @@  discard block
 block discarded – undo
48 48
             $expectedReturnType = $expectedReflection->getReturnType();
49 49
             $actualReturnType   = $actualReflection->getReturnType();
50 50
             $name               = $expectedReturnType instanceof ReflectionNamedType ?
51
-                $expectedReturnType->getName() :
52
-                strval($expectedReturnType);
51
+                $expectedReturnType->getName() : strval($expectedReturnType);
53 52
             $actName = $actualReturnType instanceof ReflectionNamedType ?
54
-                $actualReturnType->getName() :
55
-                strval($actualReturnType);
53
+                $actualReturnType->getName() : strval($actualReturnType);
56 54
 
57 55
             assert(
58 56
                 $name === $actName,
@@ -77,11 +75,9 @@  discard block
 block discarded – undo
77 75
                 $expectedParmType = $expectedParm->getType();
78 76
                 $actualParmType   = $actualParm->getType();
79 77
                 $name             = $expectedParmType instanceof ReflectionNamedType ?
80
-                    $expectedParmType->getName() :
81
-                    strval($expectedParmType);
78
+                    $expectedParmType->getName() : strval($expectedParmType);
82 79
                 $actName = $actualParmType instanceof ReflectionNamedType ?
83
-                    $actualParmType->getName() :
84
-                    strval($actualParmType);
80
+                    $actualParmType->getName() : strval($actualParmType);
85 81
 
86 82
                 //TODO: improve this to check that the actual type does not return a childType;
87 83
                 assert(
@@ -107,8 +103,7 @@  discard block
 block discarded – undo
107 103
             if ($parameter->hasType()) {
108 104
                 $parmType        = $parameter->getType();
109 105
                 $parmName        = $parmType instanceof ReflectionNamedType ?
110
-                                    $parmType->getName() :
111
-                                    strval($parmType);
106
+                                    $parmType->getName() : strval($parmType);
112 107
                 $parameterString .= $parmType->allowsNull() ? '?' : '';
113 108
                 $parameterString .= $parmName . ' ';
114 109
             }
@@ -127,8 +122,7 @@  discard block
 block discarded – undo
127 122
         if ($reflection->hasReturnType()) {
128 123
             $returnType = $reflection->getReturnType();
129 124
             $name       = $returnType instanceof ReflectionNamedType ?
130
-                $returnType->getName() :
131
-                strval($returnType);
125
+                $returnType->getName() : strval($returnType);
132 126
             $return .= ': ' . $name;
133 127
         }
134 128
         return sprintf('function(%s)%s', implode(',', $parameters), $return);
Please login to merge, or discard this patch.
src/Edm/Validation/ValidationContext.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,12 +56,10 @@
 block discarded – undo
56 56
         $stem           = is_array($isBad) ? new ReflectionMethod(...$isBad) : new ReflectionFunction($isBad);
57 57
         $stemReturnType = $stem->getReturnType();
58 58
         $stemName       = $stemReturnType instanceof ReflectionNamedType ?
59
-            $stemReturnType->getName() :
60
-            strval($stemReturnType);
59
+            $stemReturnType->getName() : strval($stemReturnType);
61 60
         $stemParmType = $stem->getParameters()[0]->getType();
62 61
         $stemParmName = $stemParmType instanceof ReflectionNamedType ?
63
-            $stemParmType->getName() :
64
-            strval($stemParmType);
62
+            $stemParmType->getName() : strval($stemParmType);
65 63
 
66 64
         /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts. */
67 65
         assert(
Please login to merge, or discard this patch.
IStructuralProperty/StructuralPropertyInvalidPropertyType.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
         assert($property instanceof IStructuralProperty);
25 25
         if ($property->getDeclaringType()->getTypeKind()->isRow()) {
26 26
             $validatedType = $property->getType()->isCollection() ?
27
-                $property->getType()->asCollection()->elementType()->getDefinition() :
28
-                $property->getType()->getDefinition();
27
+                $property->getType()->asCollection()->elementType()->getDefinition() : $property->getType()->getDefinition();
29 28
 
30 29
             EdmUtil::checkArgumentNull($validatedType, 'validatedType');
31 30
             if (!$validatedType->getTypeKind()->isPrimitive() &&
Please login to merge, or discard this patch.
StructuralPropertyInvalidPropertyTypeConcurrencyMode.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@
 block discarded – undo
43 43
                 StringConst::EdmModel_Validator_Semantic_InvalidPropertyTypeConcurrencyMode(
44 44
                     (
45 45
                         $propType->isCollection() ?
46
-                        EdmConstants::Type_Collection :
47
-                        $key
46
+                        EdmConstants::Type_Collection : $key
48 47
                     )
49 48
                 )
50 49
             );
Please login to merge, or discard this patch.
IFunctionImport/FunctionImportEntityTypeDoesNotMatchEntitySet.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
32 32
         if (null !== $functionImport->getEntitySet() && null !== $returnType) {
33 33
             /** @var ITypeReference $elementType */
34 34
             $elementType = $returnType->isCollection() ?
35
-                $returnType->asCollection()->elementType() :
36
-                $returnType;
35
+                $returnType->asCollection()->elementType() : $returnType;
37 36
             EdmUtil::checkArgumentNull($elementType->getDefinition(), 'elementType->getDefinition');
38 37
             if ($elementType->isEntity()) {
39 38
                 $returnedEntityType = $elementType->asEntity()->entityDefinition();
Please login to merge, or discard this patch.
IFunctionImport/FunctionImportUnsupportedReturnTypeAfterV1.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
         assert($functionImport instanceof IFunctionImport);
25 25
         if (null !== $functionImport->getReturnType()) {
26 26
             $elementType = $functionImport->getReturnType()->isCollection() ?
27
-                $functionImport->getReturnType()->asCollection()->elementType() :
28
-                $functionImport->getReturnType();
27
+                $functionImport->getReturnType()->asCollection()->elementType() : $functionImport->getReturnType();
29 28
             if (!$elementType->isPrimitive() &&
30 29
                 !$elementType->isEntity() &&
31 30
                 !$elementType->isComplex() &&
Please login to merge, or discard this patch.
ImmediateValueAnnotationElementAnnotationHasNameAndNamespace.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
                     ) ?? false
37 37
             )) {
38 38
                 $error = null;
39
-                if (!
40
-                ValidationHelper::validateValueCanBeWrittenAsXmlElementAnnotation(
39
+                if (!ValidationHelper::validateValueCanBeWrittenAsXmlElementAnnotation(
41 40
                     $stringValue,
42 41
                     $annotation->getNamespaceUri(),
43 42
                     $annotation->getName(),
Please login to merge, or discard this patch.
IDirectValueAnnotation/DirectValueAnnotationHasXmlSerializableName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
             // Note: this check can be done without the try/catch block, but we need XmlConvert.IsStartNCNameChar and
37 37
             // XmlConvert.IsNCNameChar, which are not available in 3.5.
38 38
             if (!XmlConvert::verifyNCName($annotation->getName())) {
39
-                $value         = $annotation->getValue() ;
39
+                $value         = $annotation->getValue();
40 40
                 $errorLocation = ($value === null || !($value instanceof IValue)) ? null : $value->location();
41 41
                 $error         = new EdmError(
42 42
                     $errorLocation,
Please login to merge, or discard this patch.
src/Edm/Validation/EdmValidator.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
28 28
     public static function validate(IModel $root, $versionOrRuleset, array &$errors): bool
29 29
     {
30 30
         $ruleSet = $versionOrRuleset instanceof Version ?
31
-            ValidationRuleSet::getEdmModelRuleSet($versionOrRuleset) :
32
-            $versionOrRuleset;
31
+            ValidationRuleSet::getEdmModelRuleSet($versionOrRuleset) : $versionOrRuleset;
33 32
         assert($ruleSet instanceof ValidationRuleSet);
34 33
         $errors = InterfaceValidator::validateModelStructureAndSemantics($root, $ruleSet);
35 34
         return count($errors) === 0;
Please login to merge, or discard this patch.