Passed
Pull Request — master (#50)
by Alex
03:38
created
src/Csdl/Internal/Serialization/EdmModelCsdlSerializationVisitor.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
 
1295 1295
         // Association Set
1296 1296
         if (!($this->model->GetAssociationSetName($thisEntitySet, $thisNavprop) ==
1297
-              $this->model->GetAssociationSetName($thatEntitySet, $thatNavprop) &&
1297
+                $this->model->GetAssociationSetName($thatEntitySet, $thatNavprop) &&
1298 1298
             $this->model->GetAssociationFullName($thisNavprop) == $this->model->GetAssociationFullName($thatNavprop))) {
1299 1299
             return false;
1300 1300
         }
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
 
1317 1317
         if (null !== $thisOtherEntitySet) {
1318 1318
             if (!($this->model->GetAssociationEndName($thisNavprop->getPartner()) ==
1319
-                  $this->model->GetAssociationEndName($thatNavprop->getPartner()) &&
1319
+                    $this->model->GetAssociationEndName($thatNavprop->getPartner()) &&
1320 1320
                   $thisOtherEntitySet->getName() == $thatOtherEntitySet->getName())) {
1321 1321
                 return false;
1322 1322
             }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -132,8 +132,7 @@  discard block
 block discarded – undo
132 132
         $alias = null;
133 133
         if ($this->namespaceAliasMappings != null) {
134 134
             $alias = array_key_exists($element->getNamespace(), $this->namespaceAliasMappings) ?
135
-                $this->namespaceAliasMappings[$element->getNamespace()] :
136
-                null;
135
+                $this->namespaceAliasMappings[$element->getNamespace()] : null;
137 136
         }
138 137
 
139 138
         $this->schemaWriter->WriteSchemaElementHeader($element, $alias, $mappings);
@@ -609,7 +608,7 @@  discard block
 block discarded – undo
609 608
     protected function ProcessPropertyReferenceExpression(IPropertyReferenceExpression $expression): void
610 609
     {
611 610
         $this->BeginElement($expression, [$this->schemaWriter, 'WritePropertyReferenceExpressionElementHeader']);
612
-        if ($expression->getBase()!= null) {
611
+        if ($expression->getBase() != null) {
613 612
             $this->VisitExpression($expression->getBase());
614 613
         }
615 614
 
@@ -1208,10 +1207,10 @@  discard block
 block discarded – undo
1208 1207
             return false;
1209 1208
         }
1210 1209
 
1211
-        $thisAssociationAnnotations =[];
1210
+        $thisAssociationAnnotations = [];
1212 1211
         $thisEnd1Annotations        = [];
1213
-        $thisEnd2Annotations        =[];
1214
-        $thisConstraintAnnotations  =[];
1212
+        $thisEnd2Annotations        = [];
1213
+        $thisConstraintAnnotations  = [];
1215 1214
         $this->model->GetAssociationAnnotations(
1216 1215
             $thisPrimary,
1217 1216
             $thisAssociationAnnotations,
@@ -1223,7 +1222,7 @@  discard block
 block discarded – undo
1223 1222
         $thatAssociationAnnotations = [];
1224 1223
         $thatEnd1Annotations        = [];
1225 1224
         $thatEnd2Annotations        = [];
1226
-        $thatConstraintAnnotations  =[];
1225
+        $thatConstraintAnnotations  = [];
1227 1226
         $this->model->GetAssociationAnnotations(
1228 1227
             $thatPrimary,
1229 1228
             $thatAssociationAnnotations,
@@ -1268,7 +1267,7 @@  discard block
 block discarded – undo
1268 1267
         if (null === $theseProperties || null === $thoseProperties) {
1269 1268
             return false;
1270 1269
         }
1271
-        $numProp   = count($theseProperties);
1270
+        $numProp = count($theseProperties);
1272 1271
         if ($numProp != count($thoseProperties)) {
1273 1272
             return false;
1274 1273
         }
@@ -1339,8 +1338,8 @@  discard block
 block discarded – undo
1339 1338
         );
1340 1339
 
1341 1340
         $thatAssociationSetAnnotations = [];
1342
-        $thatEnd1Annotations           =[];
1343
-        $thatEnd2Annotations           =[];
1341
+        $thatEnd1Annotations           = [];
1342
+        $thatEnd2Annotations           = [];
1344 1343
         $this->model->GetAssociationSetAnnotations(
1345 1344
             $thatEntitySet,
1346 1345
             $thatNavprop,
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.
src/Helpers/ToTraceString.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             case $element instanceof IProperty:
54 54
                 assert($element instanceof IProperty);
55 55
                 $type = $element->getType();
56
-                return $element->getName() ?? '' . ':' . ($type !== null ? self::ToTraceString($type) :'');
56
+                return $element->getName() ?? '' . ':' . ($type !== null ? self::ToTraceString($type) : '');
57 57
             case $element instanceof IEntityReferenceType:
58 58
                 assert($element instanceof IEntityReferenceType);
59 59
                 return strval(TypeKind::EntityReference()->getKey()) . '(' . (null !== $element->getEntityType() ?
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $sb,
189 189
             EdmConstants::FacetName_Srid,
190 190
             null !== $type->getSpatialReferenceIdentifier()
191
-                ? $type->getSpatialReferenceIdentifier(): EdmConstants::Value_SridVariable
191
+                ? $type->getSpatialReferenceIdentifier() : EdmConstants::Value_SridVariable
192 192
         );
193 193
         return $sb;
194 194
     }
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.
src/Edm/Validation/Internal/InterfaceValidator/VisitorOfIValue.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $this->lookup[ValueKind::Floating()->getValue()]       = IFloatingValue::class;
40 40
         $this->lookup[ValueKind::Guid()->getValue()]           = IGuidValue::class;
41 41
         $this->lookup[ValueKind::Integer()->getValue()]        = IIntegerValue::class;
42
-        $this->lookup[ValueKind::Null()->getValue()]           = INullValue::class;
42
+        $this->lookup[ValueKind::null()->getValue()]           = INullValue::class;
43 43
         $this->lookup[ValueKind::String()->getValue()]         = IStringValue::class;
44 44
         $this->lookup[ValueKind::Structured()->getValue()]     = IStructuredValue::class;
45 45
         $this->lookup[ValueKind::Time()->getValue()]           = ITimeValue::class;
Please login to merge, or discard this patch.
src/Helpers/VocabularyAnnotationHelpers.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         /** @var IVocabularyAnnotation $annotation */
20 20
         $annotation = $this;
21 21
         return $annotation->GetSerializationLocation($model) ==
22
-               EdmVocabularyAnnotationSerializationLocation::Inline() || null === $annotation->TargetString();
22
+                EdmVocabularyAnnotationSerializationLocation::Inline() || null === $annotation->TargetString();
23 23
     }
24 24
 
25 25
     public function TargetString(): string
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.
src/Csdl/Internal/Serialization/EdmModelCsdlSchemaWriter.php 1 patch
Spacing   +5 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1352,8 +1352,7 @@  discard block
 block discarded – undo
1352 1352
      */
1353 1353
     public function WriteOptionalAttribute(string $attribute, $value, $defaultValue, callable $toXml): void
1354 1354
     {
1355
-        $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) :
1356
-            new ReflectionFunction($toXml);
1355
+        $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : new ReflectionFunction($toXml);
1357 1356
         /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/
1358 1357
         assert(
1359 1358
             1 === count(($stem)->getParameters()),
@@ -1361,8 +1360,7 @@  discard block
 block discarded – undo
1361 1360
         );
1362 1361
         $stemType = $stem->getReturnType();
1363 1362
         $name = $stemType instanceof ReflectionNamedType ?
1364
-            $stemType->getName() :
1365
-            strval($stemType);
1363
+            $stemType->getName() : strval($stemType);
1366 1364
         /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/
1367 1365
         assert(
1368 1366
             'string' === $name,
@@ -1381,8 +1379,7 @@  discard block
 block discarded – undo
1381 1379
      */
1382 1380
     public function WriteRequiredAttribute(string $attribute, $value, callable $toXml): void
1383 1381
     {
1384
-        $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) :
1385
-            new ReflectionFunction($toXml);
1382
+        $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : new ReflectionFunction($toXml);
1386 1383
         /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/
1387 1384
         assert(
1388 1385
             1 === count($stem->getParameters()),
@@ -1390,8 +1387,7 @@  discard block
 block discarded – undo
1390 1387
         );
1391 1388
         $stemType = $stem->getReturnType();
1392 1389
         $name = $stemType instanceof ReflectionNamedType ?
1393
-            $stemType->getName() :
1394
-            strval($stemType);
1390
+            $stemType->getName() : strval($stemType);
1395 1391
         /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/
1396 1392
         assert(
1397 1393
             'string' === $name,
@@ -1488,7 +1484,7 @@  discard block
 block discarded – undo
1488 1484
 
1489 1485
     private static function SridAsXml(?int $i): string
1490 1486
     {
1491
-        return $i !== null ? strval($i) :  CsdlConstants::Value_SridVariable;
1487
+        return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable;
1492 1488
     }
1493 1489
 
1494 1490
     /**
Please login to merge, or discard this patch.
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.