@@ -24,8 +24,7 @@ |
||
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() && |
@@ -32,8 +32,7 @@ |
||
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(); |
@@ -36,8 +36,7 @@ |
||
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(), |
@@ -36,7 +36,7 @@ |
||
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, |
@@ -28,8 +28,7 @@ |
||
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; |
@@ -20,11 +20,11 @@ |
||
20 | 20 | } |
21 | 21 | public static function getCycleSentinel(): ?stdClass |
22 | 22 | { |
23 | - return (object)[]; |
|
23 | + return (object) []; |
|
24 | 24 | } |
25 | 25 | public static function getSecondPassCycleSentinel(): ?stdClass |
26 | 26 | { |
27 | - return (object)[]; |
|
27 | + return (object) []; |
|
28 | 28 | } |
29 | 29 | public static function getBoxed(bool $value) |
30 | 30 | { |
@@ -1351,8 +1351,7 @@ discard block |
||
1351 | 1351 | */ |
1352 | 1352 | public function writeOptionalAttribute(string $attribute, $value, $defaultValue, callable $toXml): void |
1353 | 1353 | { |
1354 | - $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : |
|
1355 | - new ReflectionFunction($toXml); |
|
1354 | + $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : new ReflectionFunction($toXml); |
|
1356 | 1355 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1357 | 1356 | assert( |
1358 | 1357 | 1 === count(($stem)->getParameters()), |
@@ -1360,8 +1359,7 @@ discard block |
||
1360 | 1359 | ); |
1361 | 1360 | $stemType = $stem->getReturnType(); |
1362 | 1361 | $name = $stemType instanceof ReflectionNamedType ? |
1363 | - $stemType->getName() : |
|
1364 | - strval($stemType); |
|
1362 | + $stemType->getName() : strval($stemType); |
|
1365 | 1363 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1366 | 1364 | assert( |
1367 | 1365 | 'string' === $name, |
@@ -1380,8 +1378,7 @@ discard block |
||
1380 | 1378 | */ |
1381 | 1379 | public function writeRequiredAttribute(string $attribute, $value, callable $toXml): void |
1382 | 1380 | { |
1383 | - $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : |
|
1384 | - new ReflectionFunction($toXml); |
|
1381 | + $stem = is_array($toXml) ? new ReflectionMethod(...$toXml) : new ReflectionFunction($toXml); |
|
1385 | 1382 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1386 | 1383 | assert( |
1387 | 1384 | 1 === count($stem->getParameters()), |
@@ -1389,8 +1386,7 @@ discard block |
||
1389 | 1386 | ); |
1390 | 1387 | $stemType = $stem->getReturnType(); |
1391 | 1388 | $name = $stemType instanceof ReflectionNamedType ? |
1392 | - $stemType->getName() : |
|
1393 | - strval($stemType); |
|
1389 | + $stemType->getName() : strval($stemType); |
|
1394 | 1390 | /* @noinspection PhpUnhandledExceptionInspection suppressing exceptions for asserts.*/ |
1395 | 1391 | assert( |
1396 | 1392 | 'string' === $name, |
@@ -1487,7 +1483,7 @@ discard block |
||
1487 | 1483 | |
1488 | 1484 | private static function sridAsXml(?int $i): string |
1489 | 1485 | { |
1490 | - return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable; |
|
1486 | + return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable; |
|
1491 | 1487 | } |
1492 | 1488 | |
1493 | 1489 | /** |
@@ -132,8 +132,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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, |
@@ -94,8 +94,8 @@ |
||
94 | 94 | $errors = [new EdmError(new CsdlLocation(0, 0), EdmErrorCode::UnknownEdmxVersion(), StringConst::Serializer_UnknownEdmxVersion())]; |
95 | 95 | return false; |
96 | 96 | } |
97 | - } elseif (! $edmxVersion = CsdlConstants::edmToEdmxVersions($model->getEdmVersion() ?? Version::v3())) { |
|
98 | - $errors = [new EdmError(new CsdlLocation(0, 0), EdmErrorCode::UnknownEdmVersion(), StringConst::Serializer_UnknownEdmVersion()) ]; |
|
97 | + } elseif (!$edmxVersion = CsdlConstants::edmToEdmxVersions($model->getEdmVersion() ?? Version::v3())) { |
|
98 | + $errors = [new EdmError(new CsdlLocation(0, 0), EdmErrorCode::UnknownEdmVersion(), StringConst::Serializer_UnknownEdmVersion())]; |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 |