Completed
Pull Request — master (#128)
by Alex
05:11
created
src/MetadataV3/edm/EntityContainer/FunctionImportAnonymousType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
             for ($j = $i + 1; $j < $numParms; $j++) {
147 147
                 assert(
148 148
                     $this->parameter[$j] instanceof TFunctionImportParameterType,
149
-                    get_class($this->parameter[$j]). ' ' . $j
149
+                    get_class($this->parameter[$j]) . ' ' . $j
150 150
                 );
151 151
                 $inName = $this->parameter[$j]->getName();
152 152
                 if ($outName == $inName) {
Please login to merge, or discard this patch.
src/MetadataV3/edm/TSchemaType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@
 block discarded – undo
203 203
                     return false;
204 204
                 }
205 205
                 if (!in_array($navProp->getFromRole(), $roles)) {
206
-                    $msg = 'Navigation Property Role ' .$navProp->getToRole()
206
+                    $msg = 'Navigation Property Role ' . $navProp->getToRole()
207 207
                             . ' lacks a matching Property in the assocation';
208 208
                     return false;
209 209
                 }
Please login to merge, or discard this patch.
src/MetadataV3/edm/Groups/GExpressionTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -687,12 +687,12 @@
 block discarded – undo
687 687
                 $counter += isset($this->$name) ? 1 : 0;
688 688
             }
689 689
             if (-1 < $this->gExpressionMinimum && $counter < $this->gExpressionMinimum) {
690
-                $msg = $counter . ' fields not null.  Need minimum of '.$this->gExpressionMinimum. ': '
690
+                $msg = $counter . ' fields not null.  Need minimum of ' . $this->gExpressionMinimum . ': '
691 691
                         . get_class($this);
692 692
                 return false;
693 693
             }
694 694
             if (-1 < $this->gExpressionMaximum && $counter > $this->gExpressionMaximum) {
695
-                $msg = $counter . ' fields not null.  Need maximum of '.$this->gExpressionMaximum. ': '
695
+                $msg = $counter . ' fields not null.  Need maximum of ' . $this->gExpressionMaximum . ': '
696 696
                         . get_class($this);
697 697
                 return false;
698 698
             }
Please login to merge, or discard this patch.
tests/TestTypeTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@
 block discarded – undo
194 194
 
195 195
         $msg = null;
196 196
         $expected = 'OH NOES!';
197
-        $arr = [ $bar ];
197
+        $arr = [$bar];
198 198
 
199 199
         $foo = new testType();
200 200
         $this->assertFalse($foo->isChildArrayOK($arr, $msg), $msg);
Please login to merge, or discard this patch.
tests/v3/edm/EntityContainer/AssociationSetAnonymousTypeTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
 
112 112
     public function testTooManyEnds()
113 113
     {
114
-        $expected = 'Supplied array not a valid array: '.
114
+        $expected = 'Supplied array not a valid array: ' .
115 115
                     'AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType';
116 116
         $actual = null;
117 117
 
Please login to merge, or discard this patch.
src/MetadataManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $newEntity->setName($name);
65 65
         $this->addDocumentation($summary, $longDescription, $newEntity);
66 66
         $newEntity->setAbstract($isAbstract);
67
-        $newEntity->setBaseType(null === $baseType ? null:$this->getNamespace() . $baseType->getName());
67
+        $newEntity->setBaseType(null === $baseType ? null : $this->getNamespace() . $baseType->getName());
68 68
 
69 69
         $entitySet = new EntitySetAnonymousType();
70 70
         $entitySet->setName(Str::plural($newEntity->getName()));
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 
370 370
         $namespace = $this->getNamespace();
371 371
         $typeName = $expectedReturnType->getName();
372
-        $fqTypeName = $namespace.$typeName;
372
+        $fqTypeName = $namespace . $typeName;
373 373
         $fqSetName = ($entitySet == null) ? $typeName : $entitySet->getName();
374 374
 
375 375
         $returnType = new TFunctionImportReturnTypeType();
Please login to merge, or discard this patch.
tests/MetadataManagerTest.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
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());
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         $this->assertTrue($assoc instanceof TAssociationType);
212 212
         $this->assertTrue($assoc->isOK($msg), $msg);
213 213
 
214
-        $this->assertEquals('Data.'.$assoc->getName(), $principal->getRelationship());
214
+        $this->assertEquals('Data.' . $assoc->getName(), $principal->getRelationship());
215 215
         $ends = $assoc->getEnd();
216 216
 
217 217
         $this->assertEquals(2, count($ends));
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         $this->assertTrue($assoc instanceof TAssociationType);
246 246
         $this->assertTrue($assoc->isOK($msg), $msg);
247 247
 
248
-        $this->assertEquals('Data.'.$assoc->getName(), $principal->getRelationship());
248
+        $this->assertEquals('Data.' . $assoc->getName(), $principal->getRelationship());
249 249
         $ends = $assoc->getEnd();
250 250
 
251 251
         $this->assertEquals(2, count($ends));
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         $this->assertTrue($assoc instanceof TAssociationType);
280 280
         $this->assertTrue($assoc->isOK($msg), $msg);
281 281
 
282
-        $this->assertEquals('Data.'.$assoc->getName(), $principal->getRelationship());
282
+        $this->assertEquals('Data.' . $assoc->getName(), $principal->getRelationship());
283 283
         $ends = $assoc->getEnd();
284 284
 
285 285
         $this->assertEquals(2, count($ends));
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         $this->assertTrue($assoc instanceof TAssociationType);
314 314
         $this->assertTrue($assoc->isOK($msg), $msg);
315 315
 
316
-        $this->assertEquals('Data.'.$assoc->getName(), $principal->getRelationship());
316
+        $this->assertEquals('Data.' . $assoc->getName(), $principal->getRelationship());
317 317
         $ends = $assoc->getEnd();
318 318
 
319 319
         $this->assertEquals(2, count($ends));
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         $this->assertTrue($assoc instanceof TAssociationType);
348 348
         $this->assertTrue($assoc->isOK($msg), $msg);
349 349
 
350
-        $this->assertEquals('Data.'.$assoc->getName(), $principal->getRelationship());
350
+        $this->assertEquals('Data.' . $assoc->getName(), $principal->getRelationship());
351 351
         $ends = $assoc->getEnd();
352 352
 
353 353
         $this->assertEquals(2, count($ends));
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
     {
592 592
         list(, $metadataManager, $categoryType, $customerType) = $this->setUpMetadataForNavTests();
593 593
 
594
-        $expected =  'Invalid multiplicity combination - 1 1';
594
+        $expected = 'Invalid multiplicity combination - 1 1';
595 595
         $actual = null;
596 596
 
597 597
         try {
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
     {
614 614
         list(, $metadataManager, $categoryType, $customerType) = $this->setUpMetadataForNavTests();
615 615
 
616
-        $expected =  'Invalid multiplicity combination - * 0..1';
616
+        $expected = 'Invalid multiplicity combination - * 0..1';
617 617
         $actual = null;
618 618
 
619 619
         try {
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
     public function testAddComplexType()
635 635
     {
636
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
636
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
637 637
 
638 638
         $name = 'Name';
639 639
         $accessType = 'Public';
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription);
646 646
 
647 647
         $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
648
-        $this->assertEquals($oldCount+1, $newCount);
648
+        $this->assertEquals($oldCount + 1, $newCount);
649 649
         $this->assertNotNull($result);
650 650
         $this->assertTrue($result instanceof TComplexTypeType, get_class($result));
651 651
         $this->assertNotNull($result->getDocumentation());
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 
654 654
     public function testAddComplexTypeWithOnlySummary()
655 655
     {
656
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
656
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
657 657
 
658 658
         $name = 'Name';
659 659
         $accessType = 'Public';
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription);
666 666
 
667 667
         $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
668
-        $this->assertEquals($oldCount+1, $newCount);
668
+        $this->assertEquals($oldCount + 1, $newCount);
669 669
         $this->assertNotNull($result);
670 670
         $this->assertTrue($result instanceof TComplexTypeType, get_class($result));
671 671
         $this->assertNull($result->getDocumentation());
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 
674 674
     public function testAddComplexTypeWithOnlyDescription()
675 675
     {
676
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
676
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
677 677
 
678 678
         $name = 'Name';
679 679
         $accessType = 'Public';
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
         $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription);
686 686
 
687 687
         $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
688
-        $this->assertEquals($oldCount+1, $newCount);
688
+        $this->assertEquals($oldCount + 1, $newCount);
689 689
         $this->assertNotNull($result);
690 690
         $this->assertTrue($result instanceof TComplexTypeType, get_class($result));
691 691
         $this->assertNull($result->getDocumentation());
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
         $expected = 'Default value cannot be object or array';
697 697
         $actual = null;
698 698
 
699
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
699
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
700 700
         $complex = m::mock(TComplexTypeType::class);
701 701
         $name = 'name';
702 702
         $type = 'type';
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
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';
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 
732 732
     public function testAddPropertyToComplexTypeDefaultValueBoolean()
733 733
     {
734
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
734
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
735 735
         $complex = m::mock(TComplexTypeType::class);
736 736
         $complex->shouldReceive('addToProperty')
737 737
             ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once();
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 
758 758
     public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary()
759 759
     {
760
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
760
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
761 761
         $complex = m::mock(TComplexTypeType::class);
762 762
         $complex->shouldReceive('addToProperty')
763 763
             ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once();
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 
785 785
     public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription()
786 786
     {
787
-        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
787
+        list(, $metadataManager,,) = $this->setUpMetadataForNavTests();
788 788
         $complex = m::mock(TComplexTypeType::class);
789 789
         $complex->shouldReceive('addToProperty')
790 790
             ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once();
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
         $longDescription = new TTextType();
904 904
 
905 905
         $metadataManager = new MetadataManager();
906
-        list($result, ) = $metadataManager->addEntityType($name, null, false, $accessType, $summary, $longDescription);
906
+        list($result,) = $metadataManager->addEntityType($name, null, false, $accessType, $summary, $longDescription);
907 907
         $this->assertNotNull($result->getDocumentation());
908 908
     }
909 909
 
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
         $longDescription = null;
916 916
 
917 917
         $metadataManager = new MetadataManager();
918
-        list($result, ) = $metadataManager->addEntityType($name, null, false, $accessType, $summary, $longDescription);
918
+        list($result,) = $metadataManager->addEntityType($name, null, false, $accessType, $summary, $longDescription);
919 919
         $this->assertNull($result->getDocumentation());
920 920
     }
921 921
 
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
         $longDescription = new TTextType();
928 928
 
929 929
         $metadataManager = new MetadataManager();
930
-        list($result, ) = $metadataManager->addEntityType($name, null, false, $accessType, $summary, $longDescription);
930
+        list($result,) = $metadataManager->addEntityType($name, null, false, $accessType, $summary, $longDescription);
931 931
         $this->assertNull($result->getDocumentation());
932 932
     }
933 933
 
Please login to merge, or discard this patch.
tests/MetadataManagerNavigationTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->assertTrue($metadataManager->getEdmx()->isOK($msg), $msg);
114 114
 
115 115
         $expectedRelation = 'Data.Category_Products_Product_Category';
116
-        list($principalNav, ) = $metadataManager->addNavigationPropertyToEntityType(
116
+        list($principalNav,) = $metadataManager->addNavigationPropertyToEntityType(
117 117
             $categoryType, '*', 'Products', $productType, '1', 'Category', ['CategoryID'], ['CategoryID']
118 118
         );
119 119
         $this->assertEquals($expectedRelation, $principalNav->getRelationship());
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $associationType = null;
148 148
         foreach ($dom->getElementsByTagName('Association') as $eType) {
149 149
             foreach ($eType->attributes as $aType) {
150
-                if ($aType->name == 'Name' && 'Data.'.$aType->value == $ProductRelationship) {
150
+                if ($aType->name == 'Name' && 'Data.' . $aType->value == $ProductRelationship) {
151 151
                     $associationType = $eType;
152 152
                 }
153 153
             }
Please login to merge, or discard this patch.
tests/TSchemaTypeTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         for ($i = 0; $i < 100; $i++) {
32 32
             $actualMax = max($type->getRand(), $actualMax);
33 33
         }
34
-        $this->assertLessThanOrEqual($expectedMax, $actualMax, $actualMax . ' must be less than '.$expectedMax);
34
+        $this->assertLessThanOrEqual($expectedMax, $actualMax, $actualMax . ' must be less than ' . $expectedMax);
35 35
     }
36 36
 
37 37
     public function testGetRandMinimum()
@@ -42,6 +42,6 @@  discard block
 block discarded – undo
42 42
         for ($i = 0; $i < 100; $i++) {
43 43
             $actualMin = min($type->getRand(), $actualMin);
44 44
         }
45
-        $this->assertGreaterThanOrEqual($expectedMin, $actualMin, $actualMin . ' must be less than '.$expectedMin);
45
+        $this->assertGreaterThanOrEqual($expectedMin, $actualMin, $actualMin . ' must be less than ' . $expectedMin);
46 46
     }
47 47
 }
Please login to merge, or discard this patch.