@@ -24,8 +24,7 @@ |
||
| 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() && |
@@ -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 | { |
@@ -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 | |