@@ -131,27 +131,27 @@ discard block |
||
131 | 131 | public function WriteAssociationSetElementHeader(IEntitySet $entitySet, INavigationProperty $navigationProperty): void |
132 | 132 | { |
133 | 133 | $this->xmlWriter->startElement(CsdlConstants::Element_AssociationSet); |
134 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $this->model->GetAssociationSetName($entitySet, $navigationProperty), [EdmValueWriter::class,'StringAsXml']); |
|
135 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Association, $this->model->GetAssociationFullName($navigationProperty), [EdmValueWriter::class,'StringAsXml']); |
|
134 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $this->model->GetAssociationSetName($entitySet, $navigationProperty), [EdmValueWriter::class, 'StringAsXml']); |
|
135 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Association, $this->model->GetAssociationFullName($navigationProperty), [EdmValueWriter::class, 'StringAsXml']); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | public function WriteComplexTypeElementHeader(IComplexType $complexType): void |
139 | 139 | { |
140 | 140 | $this->xmlWriter->startElement(CsdlConstants::Element_ComplexType); |
141 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $complexType->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
141 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $complexType->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
142 | 142 | $this->WriteOptionalAttribute(CsdlConstants::Attribute_BaseType, $complexType->BaseComplexType(), null, [$this, 'TypeDefinitionAsXml']); |
143 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Abstract, $complexType->isAbstract(), CsdlConstants::Default_Abstract, [EdmValueWriter::class,'BooleanAsXml']); |
|
143 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Abstract, $complexType->isAbstract(), CsdlConstants::Default_Abstract, [EdmValueWriter::class, 'BooleanAsXml']); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | public function WriteEnumTypeElementHeader(IEnumType $enumType): void |
147 | 147 | { |
148 | 148 | $this->xmlWriter->startElement(CsdlConstants::Element_EnumType); |
149 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $enumType->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
149 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $enumType->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
150 | 150 | if ($enumType->getUnderlyingType()->getPrimitiveKind() != PrimitiveTypeKind::Int32()) { |
151 | 151 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_UnderlyingType, $enumType->getUnderlyingType(), [$this, 'TypeDefinitionAsXml']); |
152 | 152 | } |
153 | 153 | |
154 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_IsFlags, $enumType->isFlags(), CsdlConstants::Default_IsFlags, [EdmValueWriter::class,'BooleanAsXml']); |
|
154 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_IsFlags, $enumType->isFlags(), CsdlConstants::Default_IsFlags, [EdmValueWriter::class, 'BooleanAsXml']); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | public function WriteDocumentationElement(IDocumentation $documentation): void |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | public function WriteAssociationSetEndElementHeader(IEntitySet $entitySet, INavigationProperty $property): void |
176 | 176 | { |
177 | 177 | $this->xmlWriter->startElement(CsdlConstants::Element_End); |
178 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($property), [EdmValueWriter::class,'StringAsXml']); |
|
179 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_EntitySet, $entitySet->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
178 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($property), [EdmValueWriter::class, 'StringAsXml']); |
|
179 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_EntitySet, $entitySet->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | public function WriteAssociationEndElementHeader(INavigationProperty $associationEnd): void |
@@ -184,15 +184,15 @@ discard block |
||
184 | 184 | $this->xmlWriter->startElement(CsdlConstants::Element_End); |
185 | 185 | $declaringType = $associationEnd->getDeclaringType(); |
186 | 186 | assert($declaringType instanceof IEntityType); |
187 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $declaringType->FullName(), [EdmValueWriter::class,'StringAsXml']); |
|
188 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($associationEnd), [EdmValueWriter::class,'StringAsXml']); |
|
187 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $declaringType->FullName(), [EdmValueWriter::class, 'StringAsXml']); |
|
188 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($associationEnd), [EdmValueWriter::class, 'StringAsXml']); |
|
189 | 189 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_Multiplicity, $associationEnd->Multiplicity(), [self::class, 'MultiplicityAsXml']); |
190 | 190 | } |
191 | 191 | |
192 | 192 | public function WriteEntityContainerElementHeader(IEntityContainer $container): void |
193 | 193 | { |
194 | 194 | $this->xmlWriter->startElement(CsdlConstants::Element_EntityContainer); |
195 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $container->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
195 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $container->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
196 | 196 | if ($container->isDefault()) { |
197 | 197 | $this->xmlWriter->writeAttributeNs(CsdlConstants::Prefix_ODataMetadata, CsdlConstants::Attribute_IsDefaultEntityContainer, null, 'true'); |
198 | 198 | } |
@@ -204,17 +204,17 @@ discard block |
||
204 | 204 | public function WriteEntitySetElementHeader(IEntitySet $entitySet): void |
205 | 205 | { |
206 | 206 | $this->xmlWriter->startElement(CsdlConstants::Element_EntitySet); |
207 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $entitySet->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
208 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_EntityType, $entitySet->getElementType()->FullName(), [EdmValueWriter::class,'StringAsXml']); |
|
207 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $entitySet->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
208 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_EntityType, $entitySet->getElementType()->FullName(), [EdmValueWriter::class, 'StringAsXml']); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | public function WriteEntityTypeElementHeader(IEntityType $entityType): void |
212 | 212 | { |
213 | 213 | $this->xmlWriter->startElement(CsdlConstants::Element_EntityType); |
214 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $entityType->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
214 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $entityType->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
215 | 215 | $this->WriteOptionalAttribute(CsdlConstants::Attribute_BaseType, $entityType->BaseEntityType(), null, [$this, 'TypeDefinitionAsXml']); |
216 | 216 | $this->WriteOptionalAttribute(CsdlConstants::Attribute_Abstract, $entityType->isAbstract(), CsdlConstants::Default_Abstract, [EdmValueWriter::class, 'BooleanAsXml']); |
217 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_OpenType, $entityType->isOpen(), CsdlConstants::Default_OpenType, [EdmValueWriter::class,'BooleanAsXml']); |
|
217 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_OpenType, $entityType->isOpen(), CsdlConstants::Default_OpenType, [EdmValueWriter::class, 'BooleanAsXml']); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | public function WriteDeclaredKeyPropertiesElementHeader(): void |
@@ -225,24 +225,24 @@ discard block |
||
225 | 225 | public function WritePropertyRefElement(IStructuralProperty $property): void |
226 | 226 | { |
227 | 227 | $this->xmlWriter->startElement(CsdlConstants::Element_PropertyRef); |
228 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $property->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
228 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $property->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
229 | 229 | $this->WriteEndElement(); |
230 | 230 | } |
231 | 231 | |
232 | 232 | public function WriteNavigationPropertyElementHeader(INavigationProperty $member): void |
233 | 233 | { |
234 | 234 | $this->xmlWriter->startElement(CsdlConstants::Element_NavigationProperty); |
235 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $member->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
236 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Relationship, $this->model->GetAssociationFullName($member), [EdmValueWriter::class,'StringAsXml']); |
|
237 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_ToRole, $this->model->GetAssociationEndName($member->getPartner()), [EdmValueWriter::class,'StringAsXml']); |
|
238 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_FromRole, $this->model->GetAssociationEndName($member), [EdmValueWriter::class,'StringAsXml']); |
|
239 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_ContainsTarget, $member->containsTarget(), CsdlConstants::Default_ContainsTarget, [EdmValueWriter::class,'BooleanAsXml']); |
|
235 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $member->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
236 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Relationship, $this->model->GetAssociationFullName($member), [EdmValueWriter::class, 'StringAsXml']); |
|
237 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_ToRole, $this->model->GetAssociationEndName($member->getPartner()), [EdmValueWriter::class, 'StringAsXml']); |
|
238 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_FromRole, $this->model->GetAssociationEndName($member), [EdmValueWriter::class, 'StringAsXml']); |
|
239 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_ContainsTarget, $member->containsTarget(), CsdlConstants::Default_ContainsTarget, [EdmValueWriter::class, 'BooleanAsXml']); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | public function WriteOperationActionElement(string $elementName, OnDeleteAction $operationAction): void |
243 | 243 | { |
244 | 244 | $this->xmlWriter->startElement($elementName); |
245 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Action, strval($operationAction), [EdmValueWriter::class,'StringAsXml']); |
|
245 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Action, strval($operationAction), [EdmValueWriter::class, 'StringAsXml']); |
|
246 | 246 | $this->WriteEndElement(); |
247 | 247 | } |
248 | 248 | |
@@ -250,8 +250,8 @@ discard block |
||
250 | 250 | { |
251 | 251 | $xmlNamespace = self::GetCsdlNamespace($this->version); |
252 | 252 | $this->xmlWriter->startElement(CsdlConstants::Element_Schema); |
253 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Namespace, $schema->getNamespace(), '', [EdmValueWriter::class,'StringAsXml']); |
|
254 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Alias, $alias, null, [EdmValueWriter::class,'StringAsXml']); |
|
253 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Namespace, $schema->getNamespace(), '', [EdmValueWriter::class, 'StringAsXml']); |
|
254 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Alias, $alias, null, [EdmValueWriter::class, 'StringAsXml']); |
|
255 | 255 | foreach ($mappings as $mappingKey => $mappingValue) { |
256 | 256 | $this->xmlWriter->writeAttributeNs(EdmConstants::XmlNamespacePrefix, $mappingKey, null, $mappingValue); |
257 | 257 | } |
@@ -260,25 +260,25 @@ discard block |
||
260 | 260 | public function WriteAnnotationsElementHeader(string $annotationsTarget): void |
261 | 261 | { |
262 | 262 | $this->xmlWriter->startElement(CsdlConstants::Element_Annotations); |
263 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Target, $annotationsTarget, [EdmValueWriter::class,'StringAsXml']); |
|
263 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Target, $annotationsTarget, [EdmValueWriter::class, 'StringAsXml']); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | public function WriteStructuralPropertyElementHeader(IStructuralProperty $property, bool $inlineType): void |
267 | 267 | { |
268 | 268 | $this->xmlWriter->startElement(CsdlConstants::Element_Property); |
269 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $property->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
269 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $property->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
270 | 270 | if ($inlineType) { |
271 | 271 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $property->getType(), [$this, 'TypeReferenceAsXml']); |
272 | 272 | } |
273 | 273 | |
274 | 274 | $this->WriteOptionalAttribute(CsdlConstants::Attribute_ConcurrencyMode, $property->getConcurrencyMode(), CsdlConstants::$Default_ConcurrencyMode, [self::class, 'ConcurrencyModeAsXml']); |
275 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_DefaultValue, $property->getDefaultValueString(), null, [EdmValueWriter::class,'StringAsXml']); |
|
275 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_DefaultValue, $property->getDefaultValueString(), null, [EdmValueWriter::class, 'StringAsXml']); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | public function WriteEnumMemberElementHeader(IEnumMember $member): void |
279 | 279 | { |
280 | 280 | $this->xmlWriter->startElement(CsdlConstants::Element_Member); |
281 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $member->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
281 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $member->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
282 | 282 | $isExplicit = $member->IsValueExplicit($this->model); |
283 | 283 | if (null === $isExplicit || $isExplicit) { |
284 | 284 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_Value, $member->getValue(), [EdmValueWriter::class, 'PrimitiveValueAsXml']); |
@@ -287,24 +287,24 @@ discard block |
||
287 | 287 | |
288 | 288 | public function WriteNullableAttribute(ITypeReference $reference): void |
289 | 289 | { |
290 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Nullable, $reference->getNullable(), CsdlConstants::Default_Nullable, [EdmValueWriter::class,'BooleanAsXml']); |
|
290 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Nullable, $reference->getNullable(), CsdlConstants::Default_Nullable, [EdmValueWriter::class, 'BooleanAsXml']); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | public function WriteBinaryTypeAttributes(IBinaryTypeReference $reference): void |
294 | 294 | { |
295 | 295 | if ($reference->isUnBounded()) { |
296 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_MaxLength, CsdlConstants::Value_Max, [EdmValueWriter::class,'StringAsXml']); |
|
296 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_MaxLength, CsdlConstants::Value_Max, [EdmValueWriter::class, 'StringAsXml']); |
|
297 | 297 | } else { |
298 | 298 | $this->WriteOptionalAttribute(CsdlConstants::Attribute_MaxLength, $reference->getMaxLength(), null, [EdmValueWriter::class, 'IntAsXml']); |
299 | 299 | } |
300 | 300 | |
301 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_FixedLength, $reference->isFixedLength(), null, [EdmValueWriter::class,'BooleanAsXml']); |
|
301 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_FixedLength, $reference->isFixedLength(), null, [EdmValueWriter::class, 'BooleanAsXml']); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | public function WriteDecimalTypeAttributes(IDecimalTypeReference $reference): void |
305 | 305 | { |
306 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Precision, $reference->getPrecision(), null, [EdmValueWriter::class,'IntAsXml']); |
|
307 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Scale, $reference->getScale(), null, [EdmValueWriter::class,'IntAsXml']); |
|
306 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Precision, $reference->getPrecision(), null, [EdmValueWriter::class, 'IntAsXml']); |
|
307 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Scale, $reference->getScale(), null, [EdmValueWriter::class, 'IntAsXml']); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | public function WriteSpatialTypeAttributes(ISpatialTypeReference $reference): void |
@@ -314,20 +314,20 @@ discard block |
||
314 | 314 | |
315 | 315 | public function WriteStringTypeAttributes(IStringTypeReference $reference): void |
316 | 316 | { |
317 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Collation, $reference->getCollation(), null, [EdmValueWriter::class,'StringAsXml']); |
|
317 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Collation, $reference->getCollation(), null, [EdmValueWriter::class, 'StringAsXml']); |
|
318 | 318 | if ($reference->isUnbounded()) { |
319 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_MaxLength, CsdlConstants::Value_Max, [EdmValueWriter::class,'StringAsXml']); |
|
319 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_MaxLength, CsdlConstants::Value_Max, [EdmValueWriter::class, 'StringAsXml']); |
|
320 | 320 | } else { |
321 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_MaxLength, $reference->getMaxLength(), null, [EdmValueWriter::class,'IntAsXml']); |
|
321 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_MaxLength, $reference->getMaxLength(), null, [EdmValueWriter::class, 'IntAsXml']); |
|
322 | 322 | } |
323 | 323 | |
324 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_FixedLength, $reference->isFixedLength(), null, [EdmValueWriter::class,'BooleanAsXml']); |
|
325 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Unicode, $reference->isUnicode(), null, [EdmValueWriter::class,'BooleanAsXml']); |
|
324 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_FixedLength, $reference->isFixedLength(), null, [EdmValueWriter::class, 'BooleanAsXml']); |
|
325 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Unicode, $reference->isUnicode(), null, [EdmValueWriter::class, 'BooleanAsXml']); |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | public function WriteTemporalTypeAttributes(ITemporalTypeReference $reference): void |
329 | 329 | { |
330 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Precision, $reference->getPrecision(), null, [EdmValueWriter::class,'IntAsXml']); |
|
330 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Precision, $reference->getPrecision(), null, [EdmValueWriter::class, 'IntAsXml']); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | public function WriteReferentialConstraintElementHeader(INavigationProperty $constraint): void |
@@ -338,20 +338,20 @@ discard block |
||
338 | 338 | public function WriteReferentialConstraintPrincipalEndElementHeader(INavigationProperty $end): void |
339 | 339 | { |
340 | 340 | $this->xmlWriter->startElement(CsdlConstants::Element_Principal); |
341 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($end), [EdmValueWriter::class,'StringAsXml']); |
|
341 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($end), [EdmValueWriter::class, 'StringAsXml']); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | public function WriteReferentialConstraintDependentEndElementHeader(INavigationProperty $end): void |
345 | 345 | { |
346 | 346 | $this->xmlWriter->startElement(CsdlConstants::Element_Dependent); |
347 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($end), [EdmValueWriter::class,'StringAsXml']); |
|
347 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Role, $this->model->GetAssociationEndName($end), [EdmValueWriter::class, 'StringAsXml']); |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | public function WriteNamespaceUsingElement(string $usingNamespace, string $alias): void |
351 | 351 | { |
352 | 352 | $this->xmlWriter->startElement(CsdlConstants::Element_Using); |
353 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Namespace, $usingNamespace, [EdmValueWriter::class,'StringAsXml']); |
|
354 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Alias, $alias, [EdmValueWriter::class,'StringAsXml']); |
|
353 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Namespace, $usingNamespace, [EdmValueWriter::class, 'StringAsXml']); |
|
354 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Alias, $alias, [EdmValueWriter::class, 'StringAsXml']); |
|
355 | 355 | $this->WriteEndElement(); |
356 | 356 | } |
357 | 357 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | public function WriteFunctionElementHeader(IFunction $function, bool $inlineReturnType): void |
375 | 375 | { |
376 | 376 | $this->xmlWriter->startElement(CsdlConstants::Element_Function); |
377 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $function->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
377 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $function->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
378 | 378 | if ($inlineReturnType) { |
379 | 379 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_ReturnType, $function->getReturnType(), [$this, 'TypeReferenceAsXml']); |
380 | 380 | } |
@@ -400,21 +400,21 @@ discard block |
||
400 | 400 | } |
401 | 401 | |
402 | 402 | $this->xmlWriter->startElement(CsdlConstants::Element_FunctionImport); |
403 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $functionImport->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
404 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_ReturnType, $functionImport->getReturnType(), null, [$this,'TypeReferenceAsXml']); |
|
403 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $functionImport->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
404 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_ReturnType, $functionImport->getReturnType(), null, [$this, 'TypeReferenceAsXml']); |
|
405 | 405 | |
406 | 406 | // IsSideEffecting is optional, however its default applies to non-composable function imports only. |
407 | 407 | // Composable function imports can't be side-effecting, so we don't emit false. |
408 | 408 | if (!$functionImport->isComposable() && $functionImport->isSideEffecting() != CsdlConstants::Default_IsSideEffecting) { |
409 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_IsSideEffecting, $functionImport->isSideEffecting(), [EdmValueWriter::class,'BooleanAsXml']); |
|
409 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_IsSideEffecting, $functionImport->isSideEffecting(), [EdmValueWriter::class, 'BooleanAsXml']); |
|
410 | 410 | } |
411 | 411 | |
412 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_IsComposable, $functionImport->isComposable(), CsdlConstants::Default_IsComposable, [EdmValueWriter::class,'BooleanAsXml']); |
|
413 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_IsBindable, $functionImport->isBindable(), CsdlConstants::Default_IsBindable, [EdmValueWriter::class,'BooleanAsXml']); |
|
412 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_IsComposable, $functionImport->isComposable(), CsdlConstants::Default_IsComposable, [EdmValueWriter::class, 'BooleanAsXml']); |
|
413 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_IsBindable, $functionImport->isBindable(), CsdlConstants::Default_IsBindable, [EdmValueWriter::class, 'BooleanAsXml']); |
|
414 | 414 | $entitySetReference = $functionImport->getEntitySet(); |
415 | 415 | if ($functionImport->getEntitySet() != null) { |
416 | 416 | if ($entitySetReference instanceof IEntitySetReferenceExpression) { |
417 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_EntitySet, $entitySetReference->getReferencedEntitySet()->getName(), null, [EdmValueWriter::class,'StringAsXml']); |
|
417 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_EntitySet, $entitySetReference->getReferencedEntitySet()->getName(), null, [EdmValueWriter::class, 'StringAsXml']); |
|
418 | 418 | } else { |
419 | 419 | $pathExpression = $functionImport->getEntitySet(); |
420 | 420 | if ($pathExpression instanceof IPathExpression) { |
@@ -429,9 +429,9 @@ discard block |
||
429 | 429 | public function WriteFunctionParameterElementHeader(IFunctionParameter $parameter, bool $inlineType): void |
430 | 430 | { |
431 | 431 | $this->xmlWriter->startElement(CsdlConstants::Element_Parameter); |
432 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $parameter->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
432 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $parameter->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
433 | 433 | if ($inlineType) { |
434 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $parameter->getType(), [$this,'TypeReferenceAsXml']); |
|
434 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $parameter->getType(), [$this, 'TypeReferenceAsXml']); |
|
435 | 435 | } |
436 | 436 | |
437 | 437 | $this->WriteOptionalAttribute(CsdlConstants::Attribute_Mode, $parameter->getMode(), CsdlConstants::$Default_FunctionParameterMode, [self::class, 'FunctionParameterModeAsXml']); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | { |
442 | 442 | $this->xmlWriter->startElement(CsdlConstants::Element_CollectionType); |
443 | 443 | if ($inlineType) { |
444 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_ElementType, $collectionType->getElementType(), [$this,'TypeReferenceAsXml']); |
|
444 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_ElementType, $collectionType->getElementType(), [$this, 'TypeReferenceAsXml']); |
|
445 | 445 | } |
446 | 446 | } |
447 | 447 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | break; |
460 | 460 | case ExpressionKind::BooleanConstant(): |
461 | 461 | assert($expression instanceof IBooleanConstantExpression); |
462 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Bool, $expression->getValue(), [EdmValueWriter::class,'BooleanAsXml']); |
|
462 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Bool, $expression->getValue(), [EdmValueWriter::class, 'BooleanAsXml']); |
|
463 | 463 | break; |
464 | 464 | case ExpressionKind::DateTimeConstant(): |
465 | 465 | assert($expression instanceof IDateTimeConstantExpression); |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | break; |
476 | 476 | case ExpressionKind::FloatingConstant(): |
477 | 477 | assert($expression instanceof IFloatingConstantExpression); |
478 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Float, $expression->getValue(), [EdmValueWriter::class, 'FloatAsXml']); |
|
478 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Float, $expression->getValue(), [EdmValueWriter::class, 'FloatAsXml']); |
|
479 | 479 | break; |
480 | 480 | case ExpressionKind::GuidConstant(): |
481 | 481 | assert($expression instanceof IGuidConstantExpression); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | break; |
492 | 492 | case ExpressionKind::StringConstant(): |
493 | 493 | assert($expression instanceof IStringConstantExpression); |
494 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_String, $expression->getValue(), [EdmValueWriter::class,'StringAsXml']); |
|
494 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_String, $expression->getValue(), [EdmValueWriter::class, 'StringAsXml']); |
|
495 | 495 | break; |
496 | 496 | case ExpressionKind::TimeConstant(): |
497 | 497 | assert($expression instanceof ITimeConstantExpression); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | { |
508 | 508 | $this->xmlWriter->startElement(CsdlConstants::Element_ValueAnnotation); |
509 | 509 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_Term, $annotation->getTerm(), [$this, 'TermAsXml']); |
510 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Qualifier, $annotation->getQualifier(), null, [EdmValueWriter::class,'StringAsXml']); |
|
510 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Qualifier, $annotation->getQualifier(), null, [EdmValueWriter::class, 'StringAsXml']); |
|
511 | 511 | if ($isInline) { |
512 | 512 | $this->WriteInlineExpression($annotation->getValue()); |
513 | 513 | } |
@@ -517,13 +517,13 @@ discard block |
||
517 | 517 | { |
518 | 518 | $this->xmlWriter->startElement(CsdlConstants::Element_TypeAnnotation); |
519 | 519 | $this->WriteRequiredAttribute(CsdlConstants::Attribute_Term, $annotation->getTerm(), [$this, 'TermAsXml']); |
520 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Qualifier, $annotation->getQualifier(), null, [EdmValueWriter::class,'StringAsXml']); |
|
520 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Qualifier, $annotation->getQualifier(), null, [EdmValueWriter::class, 'StringAsXml']); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | public function WritePropertyValueElementHeader(IPropertyValueBinding $value, bool $isInline): void |
524 | 524 | { |
525 | 525 | $this->xmlWriter->startElement(CsdlConstants::Element_PropertyValue); |
526 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Property, $value->getBoundProperty()->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
526 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Property, $value->getBoundProperty()->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
527 | 527 | if ($isInline) { |
528 | 528 | $this->WriteInlineExpression($value->getValue()); |
529 | 529 | } |
@@ -532,13 +532,13 @@ discard block |
||
532 | 532 | public function WriteRecordExpressionElementHeader(IRecordExpression $expression) |
533 | 533 | { |
534 | 534 | $this->xmlWriter->startElement(CsdlConstants::Element_Record); |
535 | - $this->WriteOptionalAttribute(CsdlConstants::Attribute_Type, $expression->getDeclaredType(), null, [$this,'TypeReferenceAsXml']); |
|
535 | + $this->WriteOptionalAttribute(CsdlConstants::Attribute_Type, $expression->getDeclaredType(), null, [$this, 'TypeReferenceAsXml']); |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | public function WritePropertyConstructorElementHeader(IPropertyConstructor $constructor, bool $isInline): void |
539 | 539 | { |
540 | 540 | $this->xmlWriter->startElement(CsdlConstants::Element_PropertyValue); |
541 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Property, $constructor->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
541 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Property, $constructor->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
542 | 542 | if ($isInline) { |
543 | 543 | $this->WriteInlineExpression($constructor->getValue()); |
544 | 544 | } |
@@ -643,14 +643,14 @@ discard block |
||
643 | 643 | public function WriteLabeledElementHeader(ILabeledExpression $labeledElement): void |
644 | 644 | { |
645 | 645 | $this->xmlWriter->startElement(CsdlConstants::Element_LabeledElement); |
646 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $labeledElement->getName(), [EdmValueWriter::class,'StringAsXml']); |
|
646 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Name, $labeledElement->getName(), [EdmValueWriter::class, 'StringAsXml']); |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | public function WriteIsTypeExpressionElementHeader(IIsTypeExpression $expression, bool $inlineType): void |
650 | 650 | { |
651 | 651 | $this->xmlWriter->startElement(CsdlConstants::Element_IsType); |
652 | 652 | if ($inlineType) { |
653 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $expression->getType(), [$this,'TypeReferenceAsXml']); |
|
653 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $expression->getType(), [$this, 'TypeReferenceAsXml']); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | { |
659 | 659 | $this->xmlWriter->startElement(CsdlConstants::Element_AssertType); |
660 | 660 | if ($inlineType) { |
661 | - $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $expression->getType(), [$this,'TypeReferenceAsXml']); |
|
661 | + $this->WriteRequiredAttribute(CsdlConstants::Attribute_Type, $expression->getType(), [$this, 'TypeReferenceAsXml']); |
|
662 | 662 | } |
663 | 663 | } |
664 | 664 | |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | |
807 | 807 | private static function SridAsXml(?int $i): string |
808 | 808 | { |
809 | - return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable; |
|
809 | + return $i !== null ? strval($i) : CsdlConstants::Value_SridVariable; |
|
810 | 810 | } |
811 | 811 | |
812 | 812 | private static function GetCsdlNamespace(Version $edmVersion): string |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $schema = null; |
87 | 87 | if (!array_key_exists($namespaceName, $this->modelSchemas)) { |
88 | 88 | $schema = new EdmSchema($namespaceName); |
89 | - $this->modelSchemas[$namespaceName] = $schema; |
|
89 | + $this->modelSchemas[$namespaceName] = $schema; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->modelSchemas[$namespaceName]->addSchemaElement($element); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | */ |
101 | 101 | public function getSchemaElementKind(): SchemaElementKind |
102 | 102 | { |
103 | - return SchemaElementKind::Function(); |
|
103 | + return SchemaElementKind::Function (); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -100,7 +100,7 @@ |
||
100 | 100 | */ |
101 | 101 | public function getSchemaElementKind(): SchemaElementKind |
102 | 102 | { |
103 | - return SchemaElementKind::Function(); |
|
103 | + return SchemaElementKind::function(); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -47,7 +47,7 @@ |
||
47 | 47 | ) { |
48 | 48 | $qualifiedName = $element->FullName(); |
49 | 49 | switch ($element->getSchemaElementKind()) { |
50 | - case SchemaElementKind::Function(): |
|
50 | + case SchemaElementKind::Function (): |
|
51 | 51 | assert($element instanceof IFunction); |
52 | 52 | self::AddFunction($element, $qualifiedName, $functionGroupDictionary); |
53 | 53 | break; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | ) { |
48 | 48 | $qualifiedName = $element->FullName(); |
49 | 49 | switch ($element->getSchemaElementKind()) { |
50 | - case SchemaElementKind::Function(): |
|
50 | + case SchemaElementKind::function(): |
|
51 | 51 | assert($element instanceof IFunction); |
52 | 52 | self::AddFunction($element, $qualifiedName, $functionGroupDictionary); |
53 | 53 | break; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | * @var IVocabularyAnnotation $annotation |
46 | 46 | */ |
47 | 47 | $annotation = $this; |
48 | - $model->SetAnnotationValue($annotation, EdmConstants::InternalUri, CsdlConstants::AnnotationSerializationLocationAnnotation, (object)$location); |
|
48 | + $model->SetAnnotationValue($annotation, EdmConstants::InternalUri, CsdlConstants::AnnotationSerializationLocationAnnotation, (object) $location); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $thisTypeKeys = array_keys($thisFunction->getParameters()); |
145 | 145 | $otherTypeKeys = array_keys($otherFunction->getParameters()); |
146 | - $keyCount = count($thisTypeKeys); |
|
146 | + $keyCount = count($thisTypeKeys); |
|
147 | 147 | for ($i = 0; $i < $keyCount; ++$i) { |
148 | 148 | if ( |
149 | 149 | !self::isEquivalentTo( |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | $thisTypeKeys = array_keys($thisType->getDeclaredProperties()); |
213 | 213 | $otherTypeKeys = array_keys($otherType->getDeclaredProperties()); |
214 | - $keyCount = count($thisTypeKeys); |
|
214 | + $keyCount = count($thisTypeKeys); |
|
215 | 215 | for ($i = 0; $i < $keyCount; ++$i) { |
216 | 216 | if ( |
217 | 217 | !self::isEquivalentTo( |
@@ -39,6 +39,6 @@ |
||
39 | 39 | public function PrimitiveKind(): PrimitiveTypeKind |
40 | 40 | { |
41 | 41 | $primitive = $this->PrimitiveDefinition(); |
42 | - return $primitive !== null ? $primitive->getPrimitiveKind(): PrimitiveTypeKind::None(); |
|
42 | + return $primitive !== null ? $primitive->getPrimitiveKind() : PrimitiveTypeKind::None(); |
|
43 | 43 | } |
44 | 44 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | // Otherwise, changes to the dictionary durring serialization would result in an invalid or inconsistent output. |
43 | 43 | public function GetNamespaceAliases(): array |
44 | 44 | { |
45 | - return $this->GetAnnotationValue('array', $this, EdmConstants::InternalUri, CsdlConstants::NamespaceAliasAnnotation) ??[]; |
|
45 | + return $this->GetAnnotationValue('array', $this, EdmConstants::InternalUri, CsdlConstants::NamespaceAliasAnnotation) ?? []; |
|
46 | 46 | } |
47 | 47 | /** |
48 | 48 | * Sets an annotation value for an EDM element. If the value is null, no annotation is added and an existing |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function GetNamespacePrefixMappings(): array |
249 | 249 | { |
250 | - return $this->GetAnnotationValue('array', $this, EdmConstants::InternalUri, CsdlConstants::NamespacePrefixAnnotation)??[]; |
|
250 | + return $this->GetAnnotationValue('array', $this, EdmConstants::InternalUri, CsdlConstants::NamespacePrefixAnnotation) ?? []; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $navigationPropertyMappings = $model->GetAnnotationValue(SplObjectStorage::class, $entitySet, EdmConstants::InternalUri, CsdlConstants::AssociationSetNameAnnotation); |
400 | 400 | assert($navigationPropertyMappings instanceof SplObjectStorage || $navigationPropertyMappings === null); |
401 | 401 | if ($navigationPropertyMappings !== null && $navigationPropertyMappings->offsetExists($property)) { |
402 | - $associationSetName = $navigationPropertyMappings->offsetGet($property) ; |
|
402 | + $associationSetName = $navigationPropertyMappings->offsetGet($property); |
|
403 | 403 | } else { |
404 | 404 | $associationSetName = $model->GetAssociationName($property) . 'Set'; |
405 | 405 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ); |
36 | 36 | }; |
37 | 37 | assert( |
38 | - $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
|
38 | + $expectedReflection->getNumberOfRequiredParameters() === $actualReflection->getNumberOfRequiredParameters(), |
|
39 | 39 | $messageBuilder('Incorrect Parameter Count') |
40 | 40 | ); |
41 | 41 | if ($expectedReflection->hasReturnType()) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $parameterString = ''; |
86 | 86 | if ($parameter->hasType()) { |
87 | 87 | $parameterString .= $parameter->getType()->allowsNull() ? '?' : ''; |
88 | - $parameterString .=$parameter->getType()->getName() . ' '; |
|
88 | + $parameterString .= $parameter->getType()->getName() . ' '; |
|
89 | 89 | } |
90 | 90 | $parameterString .= $parameter->isVariadic() ? '...$' : '$'; |
91 | 91 | $parameterString .= $parameter->getName(); |