@@ -57,7 +57,7 @@ |
||
57 | 57 | var_dump($drinks); |
58 | 58 | } |
59 | 59 | |
60 | -}else{ |
|
60 | +} else{ |
|
61 | 61 | throw new RuntimeException('Could not get CafeGateway'); |
62 | 62 | } |
63 | 63 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function callService(\PEIP\INF\Message\Message $message){ |
37 | 37 | if(is_callable($this->serviceCallable)){ |
38 | 38 | $res = call_user_func_array($this->serviceCallable, $message->getContent()); |
39 | - }elseif(is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')){ |
|
39 | + } elseif(is_object($this->serviceCallable) && method_exists($this->serviceCallable, 'handle')){ |
|
40 | 40 | $res = call_user_func_array(array($this->serviceCallable, 'handle'), $message->getContent()); |
41 | 41 | } |
42 | 42 | return $res; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public static function createFromFile($file){ |
95 | 95 | if(file_exists($file)){ |
96 | 96 | return self::createFromString(file_get_contents($file)); |
97 | - }else{ |
|
97 | + } else{ |
|
98 | 98 | throw new \RuntimeException('Cannot open file "'.$file.'".'); |
99 | 99 | } |
100 | 100 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $setter = self::getSetter($property); |
387 | 387 | if($setter && self::hasPublicProperty($service, 'Method', $setter)){ |
388 | 388 | $service->{$setter}($arg); |
389 | - }elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){ |
|
389 | + } elseif(in_array($property, self::hasPublicProperty($service, 'Property', $setter))){ |
|
390 | 390 | $service->$setter = $arg; |
391 | 391 | } |
392 | 392 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | $ref = trim((string)$config['ref']); |
620 | 620 | if($ref != ''){ |
621 | 621 | $service = $this->getService($ref); |
622 | - }else{ |
|
622 | + } else{ |
|
623 | 623 | $service = $this->createService($config); |
624 | 624 | } |
625 | 625 | return $service; |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | protected static function getSetter($config){ |
640 | 640 | if($config['setter']){ |
641 | 641 | $setter = (string)$config['setter']; |
642 | - }elseif($config['name']){ |
|
642 | + } elseif($config['name']){ |
|
643 | 643 | $setter = 'set'.ucfirst((string)$config['name']); |
644 | 644 | } |
645 | 645 | return $setter; |
@@ -655,26 +655,26 @@ discard block |
||
655 | 655 | protected function buildArg($config){ |
656 | 656 | if(trim((string)$config['value']) != ''){ |
657 | 657 | $arg = (string)$config['value']; |
658 | - }elseif($config->getName() == 'value'){ |
|
658 | + } elseif($config->getName() == 'value'){ |
|
659 | 659 | $arg = (string)$config; |
660 | - }elseif($config->getName() == 'list'){ |
|
660 | + } elseif($config->getName() == 'list'){ |
|
661 | 661 | $arg = array(); |
662 | 662 | foreach($config->children() as $entry){ |
663 | 663 | if($entry->getName() == 'value'){ |
664 | 664 | if($entry['key']){ |
665 | 665 | $arg[(string)$entry['key']] = (string)$entry; |
666 | - }else{ |
|
666 | + } else{ |
|
667 | 667 | $arg[] = (string)$entry; |
668 | 668 | } |
669 | - }elseif($entry->getName() == 'service'){ |
|
669 | + } elseif($entry->getName() == 'service'){ |
|
670 | 670 | $arg[] = $this->provideService($entry); |
671 | 671 | } |
672 | 672 | } |
673 | - }elseif($config->getName() == 'service'){ |
|
673 | + } elseif($config->getName() == 'service'){ |
|
674 | 674 | $arg = $this->provideService($config); |
675 | - }elseif($config->list){ |
|
675 | + } elseif($config->list){ |
|
676 | 676 | $arg = $this->buildArg($config->list); |
677 | - }elseif($config->service){ |
|
677 | + } elseif($config->service){ |
|
678 | 678 | $arg = $this->buildArg($config->service); |
679 | 679 | } |
680 | 680 | return $arg; |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | $channel = $this->services[trim((string)$channelName)]; |
743 | 743 | if($channel instanceof \PEIP\INF\Channel\Channel){ |
744 | 744 | return $channel; |
745 | - }else{ |
|
745 | + } else{ |
|
746 | 746 | return NULL; |
747 | 747 | } |
748 | 748 | } |
@@ -781,10 +781,10 @@ discard block |
||
781 | 781 | $constructor = (string)$config["constructor"]; |
782 | 782 | if($constructor != ''){ |
783 | 783 | $service = call_user_func_array(array($cls, $constructor), $arguments); |
784 | - }else{ |
|
784 | + } else{ |
|
785 | 785 | $service = self::build($cls, $arguments); |
786 | 786 | } |
787 | - }catch(\Exception $e){ |
|
787 | + } catch(\Exception $e){ |
|
788 | 788 | throw new \RuntimeException('Could not create Service "'.$cls.'" -> '.$e->getMessage()); |
789 | 789 | } |
790 | 790 | } |