Completed
Pull Request — master (#72)
by Christopher
03:38
created
src/POData/Providers/Metadata/SimpleMetadataProvider.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
      * @param string       $sourcePropertyName              The name of the property to add to the sourceResourceType
363 363
      * @param string       $targetPropertyName              The name of the property to add to the targetResourceType
364 364
      */
365
-    public function addBidirectionalResourceResourceReferenceProperty(ResourceSet $sourceResourceSet,ResourceSet $targeteResourceSet, $sourcePropertyName,$targetPropertyName)
365
+    public function addBidirectionalResourceResourceReferenceProperty(ResourceSet $sourceResourceSet, ResourceSet $targeteResourceSet, $sourcePropertyName, $targetPropertyName)
366 366
     {
367 367
         $this->_addBidirectionalReferencePropertyInternal(
368 368
             $sourceResourceSet,
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
      * @param string       $sourcePropertyName              The name of the property to add to the sourceResourceType
385 385
      * @param string       $targetPropertyName              The name of the property to add to the targetResourceType
386 386
      */
387
-    public function addBidirectionalResourceResourceSetReferenceProperty(ResourceSet $sourceResourceSet,ResourceSet $targeteResourceSet, $sourcePropertyName,$targetPropertyName)
387
+    public function addBidirectionalResourceResourceSetReferenceProperty(ResourceSet $sourceResourceSet, ResourceSet $targeteResourceSet, $sourcePropertyName, $targetPropertyName)
388 388
     {
389 389
         $this->_addBidirectionalReferencePropertyInternal(
390 390
             $sourceResourceSet,
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
      * @param string       $sourcePropertyName              The name of the property to add to the sourceResourceType
407 407
      * @param string       $targetPropertyName              The name of the property to add to the targetResourceType
408 408
      */
409
-    public function addBidirectionalResourceSetResourceReferenceProperty(ResourceSet $sourceResourceSet,ResourceSet $targeteResourceSet, $sourcePropertyName,$targetPropertyName)
409
+    public function addBidirectionalResourceSetResourceReferenceProperty(ResourceSet $sourceResourceSet, ResourceSet $targeteResourceSet, $sourcePropertyName, $targetPropertyName)
410 410
     {
411 411
         $this->_addBidirectionalReferencePropertyInternal(
412 412
             $sourceResourceSet,
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
      * @param string       $sourcePropertyName              The name of the property to add to the sourceResourceType
429 429
      * @param string       $targetPropertyName              The name of the property to add to the targetResourceType
430 430
      */
431
-    public function addBidirectionalResourceSetResourceSetReferenceProperty(ResourceSet $sourceResourceSet,ResourceSet $targeteResourceSet, $sourcePropertyName,$targetPropertyName)
431
+    public function addBidirectionalResourceSetResourceSetReferenceProperty(ResourceSet $sourceResourceSet, ResourceSet $targeteResourceSet, $sourcePropertyName, $targetPropertyName)
432 432
     {
433 433
         $this->_addBidirectionalReferencePropertyInternal(
434 434
             $sourceResourceSet,
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
     ) {
629 629
         if (!($sourceResourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE
630 630
             || $targetResourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE)
631
-			&& !($sourceResourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE
631
+            && !($sourceResourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE
632 632
             || $targetResourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE)
633 633
         ) {
634 634
             throw new InvalidOperationException(
@@ -642,24 +642,24 @@  discard block
 block discarded – undo
642 642
         $this->checkInstanceProperty($targetPropertyName, $targetResourceType);
643 643
         // check that property and resource name don't up and collide - would violate OData spec
644 644
         if (strtolower($sourcePropertyName) == strtolower($sourceResourceType->getName()) 
645
-			|| strtolower($targetResourceType) == strtolower($targetResourceType->getName()) 
646
-			) {
645
+            || strtolower($targetResourceType) == strtolower($targetResourceType->getName()) 
646
+            ) {
647 647
             throw new InvalidOperationException(
648 648
                 'Property name must be different from resource name.'
649 649
             );
650 650
         }
651 651
 
652
-		$sourceResourceProperty = new ResourceProperty($sourcePropertyName, null, $sourceResourcePropertyKind, $sourceResourceType);
652
+        $sourceResourceProperty = new ResourceProperty($sourcePropertyName, null, $sourceResourcePropertyKind, $sourceResourceType);
653 653
         $targetResourceProperty = new ResourceProperty($targetPropertyName, null, $targetResourcePropertyKind, $targetResourceType);
654 654
 
655 655
         $sourceResourceType->addProperty($sourceResourceProperty);
656
-		$targetResourceType->addProperty($targetResourceProperty);
656
+        $targetResourceType->addProperty($targetResourceProperty);
657 657
 
658 658
 
659 659
         //Customer_Orders_Orders, Order_Customer_Customers
660 660
         //(source type::name _ source property::name _ target set::name)
661 661
         $setKey = ResourceAssociationSet::BidirectionalKeyName($sourceResourceType, $targetResourceType, $sourcePropertyName, $targetPropertyName);
662
-       $set = new ResourceAssociationSet(
662
+        $set = new ResourceAssociationSet(
663 663
             $setKey,
664 664
             new ResourceAssociationSetEnd($sourceResourceSet, $sourceResourceType, $sourceResourceProperty),
665 665
             new ResourceAssociationSetEnd($targetResourceSet, $targetResourceType, $targetResourceProperty)
Please login to merge, or discard this patch.
src/POData/Providers/Metadata/ResourceAssociationSet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,9 +174,9 @@
 block discarded – undo
174 174
         return $sourceType->getName() . '_' . $linkName . '_' . $targetResourceSet->getResourceType()->getName();
175 175
     }
176 176
 
177
-    public static function BidirectionalKeyName(ResourceType $sourceType, ResourceType $targetType, $sourceLinkName,  $targetLinkName)
177
+    public static function BidirectionalKeyName(ResourceType $sourceType, ResourceType $targetType, $sourceLinkName, $targetLinkName)
178 178
     {
179
-        return $sourceType->getName() . '_' . $sourceLinkName. '_' . $targetType->getName() . '_' . $targetLinkName;
179
+        return $sourceType->getName() . '_' . $sourceLinkName . '_' . $targetType->getName() . '_' . $targetLinkName;
180 180
     }
181 181
 
182 182
 }
Please login to merge, or discard this patch.