@@ -308,7 +308,7 @@ |
||
| 308 | 308 | } |
| 309 | 309 | foreach ($this->returnType as $type) { |
| 310 | 310 | if (!is_string($type) || !$this->isTCommandTextValid($type)) { |
| 311 | - $msg = implode($type) . " must be a valid TCommandText"; |
|
| 311 | + $msg = implode($type)." must be a valid TCommandText"; |
|
| 312 | 312 | return false; |
| 313 | 313 | } |
| 314 | 314 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $ds = DIRECTORY_SEPARATOR; |
| 39 | 39 | |
| 40 | - $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
| 40 | + $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
| 41 | 41 | if (!file_exists($goodxsd)) { |
| 42 | 42 | return true; |
| 43 | 43 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $result = null; |
| 53 | 53 | |
| 54 | 54 | list($eType, $result) = $metadataManager->addEntityType("Category"); |
| 55 | - $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError()); |
|
| 55 | + $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError()); |
|
| 56 | 56 | $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity"); |
| 57 | 57 | $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String"); |
| 58 | 58 | $metadataManager->addPropertyToEntityType($eType, "Description", "String"); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $result = null; |
| 80 | 80 | |
| 81 | 81 | list($CategoryType, $result) = $metadataManager->addEntityType("Category"); |
| 82 | - $this->assertNotFalse($CategoryType, "Etype is false not type " . $metadataManager->getLastError()); |
|
| 82 | + $this->assertNotFalse($CategoryType, "Etype is false not type ".$metadataManager->getLastError()); |
|
| 83 | 83 | $metadataManager->addPropertyToEntityType($CategoryType, "CategoryID", "Int32", null, false, true, "Identity"); |
| 84 | 84 | $metadataManager->addPropertyToEntityType($CategoryType, "CategoryName", "String"); |
| 85 | 85 | $metadataManager->addPropertyToEntityType($CategoryType, "Description", "String"); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $this->assertTrue($metadataManager->getEdmx()->isOK($msg), $msg); |
| 166 | 166 | |
| 167 | 167 | $expectedRelation = "Data.Category_Products_Product_Category"; |
| 168 | - list($principalNav, ) = $metadataManager->addNavigationPropertyToEntityType( |
|
| 168 | + list($principalNav,) = $metadataManager->addNavigationPropertyToEntityType( |
|
| 169 | 169 | $CategoryType, "*", "Products", $ProductType, "1", "Category", ["CategoryID"], ["CategoryID"] |
| 170 | 170 | ); |
| 171 | 171 | $this->assertEquals($expectedRelation, $principalNav->getRelationship()); |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | { |
| 611 | 611 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
| 612 | 612 | |
| 613 | - $expected = "Invalid multiplicity combination - 1 1"; |
|
| 613 | + $expected = "Invalid multiplicity combination - 1 1"; |
|
| 614 | 614 | $actual = null; |
| 615 | 615 | |
| 616 | 616 | try { |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | { |
| 633 | 633 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
| 634 | 634 | |
| 635 | - $expected = "Invalid multiplicity combination - * 0..1"; |
|
| 635 | + $expected = "Invalid multiplicity combination - * 0..1"; |
|
| 636 | 636 | $actual = null; |
| 637 | 637 | |
| 638 | 638 | try { |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | public function testAddComplexType() |
| 654 | 654 | { |
| 655 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 655 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 656 | 656 | |
| 657 | 657 | $name = "Name"; |
| 658 | 658 | $accessType = "Public"; |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
| 665 | 665 | |
| 666 | 666 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
| 667 | - $this->assertEquals($oldCount+1, $newCount); |
|
| 667 | + $this->assertEquals($oldCount + 1, $newCount); |
|
| 668 | 668 | $this->assertNotNull($result); |
| 669 | 669 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
| 670 | 670 | $this->assertNotNull($result->getDocumentation()); |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | |
| 673 | 673 | public function testAddComplexTypeWithOnlySummary() |
| 674 | 674 | { |
| 675 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 675 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 676 | 676 | |
| 677 | 677 | $name = "Name"; |
| 678 | 678 | $accessType = "Public"; |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
| 685 | 685 | |
| 686 | 686 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
| 687 | - $this->assertEquals($oldCount+1, $newCount); |
|
| 687 | + $this->assertEquals($oldCount + 1, $newCount); |
|
| 688 | 688 | $this->assertNotNull($result); |
| 689 | 689 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
| 690 | 690 | $this->assertNull($result->getDocumentation()); |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | public function testAddComplexTypeWithOnlyDescription() |
| 694 | 694 | { |
| 695 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 695 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 696 | 696 | |
| 697 | 697 | $name = "Name"; |
| 698 | 698 | $accessType = "Public"; |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
| 705 | 705 | |
| 706 | 706 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
| 707 | - $this->assertEquals($oldCount+1, $newCount); |
|
| 707 | + $this->assertEquals($oldCount + 1, $newCount); |
|
| 708 | 708 | $this->assertNotNull($result); |
| 709 | 709 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
| 710 | 710 | $this->assertNull($result->getDocumentation()); |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | $expected = "Default value cannot be object or array"; |
| 716 | 716 | $actual = null; |
| 717 | 717 | |
| 718 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 718 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 719 | 719 | $complex = m::mock(TComplexTypeType::class); |
| 720 | 720 | $name = "name"; |
| 721 | 721 | $type = "type"; |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $expected = "Default value cannot be object or array"; |
| 735 | 735 | $actual = null; |
| 736 | 736 | |
| 737 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 737 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 738 | 738 | $complex = m::mock(TComplexTypeType::class); |
| 739 | 739 | $name = "name"; |
| 740 | 740 | $type = "type"; |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | |
| 751 | 751 | public function testAddPropertyToComplexTypeDefaultValueBoolean() |
| 752 | 752 | { |
| 753 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 753 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 754 | 754 | $complex = m::mock(TComplexTypeType::class); |
| 755 | 755 | $complex->shouldReceive('addToProperty') |
| 756 | 756 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | |
| 777 | 777 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary() |
| 778 | 778 | { |
| 779 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 779 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 780 | 780 | $complex = m::mock(TComplexTypeType::class); |
| 781 | 781 | $complex->shouldReceive('addToProperty') |
| 782 | 782 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | |
| 804 | 804 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription() |
| 805 | 805 | { |
| 806 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 806 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 807 | 807 | $complex = m::mock(TComplexTypeType::class); |
| 808 | 808 | $complex->shouldReceive('addToProperty') |
| 809 | 809 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $longDescription = new TTextType(); |
| 923 | 923 | |
| 924 | 924 | $metadataManager = new MetadataManager(); |
| 925 | - list($result, ) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 925 | + list($result,) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 926 | 926 | $this->assertNotNull($result->getDocumentation()); |
| 927 | 927 | } |
| 928 | 928 | |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | $longDescription = null; |
| 935 | 935 | |
| 936 | 936 | $metadataManager = new MetadataManager(); |
| 937 | - list($result, ) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 937 | + list($result,) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 938 | 938 | $this->assertNull($result->getDocumentation()); |
| 939 | 939 | } |
| 940 | 940 | |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | $longDescription = new TTextType(); |
| 947 | 947 | |
| 948 | 948 | $metadataManager = new MetadataManager(); |
| 949 | - list($result, ) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 949 | + list($result,) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 950 | 950 | $this->assertNull($result->getDocumentation()); |
| 951 | 951 | } |
| 952 | 952 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | public function isTFunctionImportAttributesValid(&$msg) |
| 266 | 266 | { |
| 267 | 267 | if (!$this->isTSimpleIdentifierValid($this->name)) { |
| 268 | - $msg = "Name must be a valid TSimpleIdentifier: " . get_class($this); |
|
| 268 | + $msg = "Name must be a valid TSimpleIdentifier: ".get_class($this); |
|
| 269 | 269 | return false; |
| 270 | 270 | } |
| 271 | 271 | if ($this->isComposable && $this->isSideEffecting) { |
@@ -278,11 +278,11 @@ discard block |
||
| 278 | 278 | return false; |
| 279 | 279 | }*/ |
| 280 | 280 | if (!$this->isObjectNullOrType('\AlgoWeb\ODataMetadata\MetadataV3\edm\TOperandType', $this->entitySet)) { |
| 281 | - $msg = "Entity set must be either null or an instance of TOperandType: " . get_class($this); |
|
| 281 | + $msg = "Entity set must be either null or an instance of TOperandType: ".get_class($this); |
|
| 282 | 282 | return false; |
| 283 | 283 | } |
| 284 | 284 | if (null != $this->methodAccess && !$this->isTAccessOk($this->methodAccess)) { |
| 285 | - $msg = "Method access must be a valid TAccess: " . get_class($this); |
|
| 285 | + $msg = "Method access must be a valid TAccess: ".get_class($this); |
|
| 286 | 286 | return false; |
| 287 | 287 | } |
| 288 | 288 | if (!$this->isValidArrayOK( |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $entitySet = new EntitySetAnonymousType(); |
| 64 | 64 | $entitySet->setName(Str::plural($NewEntity->getName())); |
| 65 | 65 | $namespace = $this->getNamespace(); |
| 66 | - $entityTypeName = $namespace . $NewEntity->getName(); |
|
| 66 | + $entityTypeName = $namespace.$NewEntity->getName(); |
|
| 67 | 67 | $entitySet->setEntityType($entityTypeName); |
| 68 | 68 | $entitySet->setGetterAccess($accessType); |
| 69 | 69 | |
@@ -167,17 +167,17 @@ discard block |
||
| 167 | 167 | ) { |
| 168 | 168 | $principalEntitySetName = Str::plural($principalType->getName()); |
| 169 | 169 | $dependentEntitySetName = Str::plural($dependentType->getName()); |
| 170 | - $relationName = $principalType->getName() . "_" . $principalProperty . "_" |
|
| 171 | - . $dependentType->getName() . "_" . $dependentProperty; |
|
| 170 | + $relationName = $principalType->getName()."_".$principalProperty."_" |
|
| 171 | + . $dependentType->getName()."_".$dependentProperty; |
|
| 172 | 172 | $relationName = trim($relationName, "_"); |
| 173 | 173 | |
| 174 | 174 | $namespace = $this->getNamespace(); |
| 175 | - $relationFQName = $namespace . $relationName; |
|
| 175 | + $relationFQName = $namespace.$relationName; |
|
| 176 | 176 | |
| 177 | 177 | $principalNavigationProperty = new TNavigationPropertyType(); |
| 178 | 178 | $principalNavigationProperty->setName($principalProperty); |
| 179 | - $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_")); |
|
| 180 | - $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty); |
|
| 179 | + $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_")); |
|
| 180 | + $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty); |
|
| 181 | 181 | $principalNavigationProperty->setRelationship($relationFQName); |
| 182 | 182 | $principalNavigationProperty->setGetterAccess($principalGetterAccess); |
| 183 | 183 | $principalNavigationProperty->setSetterAccess($principalSetterAccess); |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | if (!empty($dependentProperty)) { |
| 188 | 188 | $dependentNavigationProperty = new TNavigationPropertyType(); |
| 189 | 189 | $dependentNavigationProperty->setName($dependentProperty); |
| 190 | - $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty); |
|
| 191 | - $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty); |
|
| 190 | + $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty); |
|
| 191 | + $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty); |
|
| 192 | 192 | $dependentNavigationProperty->setRelationship($relationFQName); |
| 193 | 193 | $dependentNavigationProperty->setGetterAccess($dependentGetterAccess); |
| 194 | 194 | $dependentNavigationProperty->setSetterAccess($dependentSetterAccess); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | array $principalConstraintProperty = null, |
| 233 | 233 | array $dependentConstraintProperty = null |
| 234 | 234 | ) { |
| 235 | - $multCombo = [ '*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']]; |
|
| 235 | + $multCombo = ['*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']]; |
|
| 236 | 236 | $multKeys = array_keys($multCombo); |
| 237 | 237 | if (null != $dependentNavigationProperty) { |
| 238 | 238 | if ($dependentNavigationProperty->getRelationship() != $principalNavigationProperty->getRelationship()) { |
@@ -253,13 +253,13 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | if (!in_array($dependentMultiplicity, $multCombo[$principalMultiplicity])) { |
| 255 | 255 | throw new \InvalidArgumentException( |
| 256 | - "Invalid multiplicity combination - ". $principalMultiplicity . ' ' . $dependentMultiplicity |
|
| 256 | + "Invalid multiplicity combination - ".$principalMultiplicity.' '.$dependentMultiplicity |
|
| 257 | 257 | ); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | $namespace = $this->getNamespace(); |
| 261 | - $principalTypeFQName = $namespace . $principalType->getName(); |
|
| 262 | - $dependentTypeFQName = $namespace . $dependentType->getName(); |
|
| 261 | + $principalTypeFQName = $namespace.$principalType->getName(); |
|
| 262 | + $dependentTypeFQName = $namespace.$dependentType->getName(); |
|
| 263 | 263 | $association = new TAssociationType(); |
| 264 | 264 | $relationship = $principalNavigationProperty->getRelationship(); |
| 265 | 265 | if (false !== strpos($relationship, '.')) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $name = $association->getName(); |
| 311 | 311 | $as->setName($name); |
| 312 | 312 | $namespace = $this->getNamespace(); |
| 313 | - $associationSetName = $namespace . $association->getName(); |
|
| 313 | + $associationSetName = $namespace.$association->getName(); |
|
| 314 | 314 | $as->setAssociation($associationSetName); |
| 315 | 315 | $end1 = new EndAnonymousType(); |
| 316 | 316 | $end1->setRole($association->getEnd()[0]->getRole()); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | private function initSerialiser() |
| 372 | 372 | { |
| 373 | - $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata"; |
|
| 373 | + $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata"; |
|
| 374 | 374 | $this->serializer = |
| 375 | 375 | SerializerBuilder::create() |
| 376 | 376 | ->addMetadataDir($ymlDir) |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | * @param $longDescription |
| 441 | 441 | * @param $NewEntity |
| 442 | 442 | */ |
| 443 | - private function addDocumentation($summary, $longDescription, IsOK &$NewEntity) |
|
| 443 | + private function addDocumentation($summary, $longDescription, IsOK & $NewEntity) |
|
| 444 | 444 | { |
| 445 | 445 | if (null != $summary && null != $longDescription) { |
| 446 | 446 | $documentation = $this->generateDocumentation($summary, $longDescription); |