@@ -50,7 +50,7 @@ |
||
50 | 50 | $store = $this->factory->build(); |
51 | 51 | if ($store instanceof \PEIP\INF\Data\ParameterHolder) { |
52 | 52 | $this->stores[$namespace] = $store; |
53 | - }else { |
|
53 | + } else { |
|
54 | 54 | throw new \Exception('Could not build Instance of \PEIP\INF\Data\ParameterHolder from factory.'); |
55 | 55 | } |
56 | 56 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $store = $this->factory->build(); |
55 | 55 | if ($store instanceof \PEIP\INF\Data\Store) { |
56 | 56 | $this->setPrivateValue($namespace, $store); |
57 | - }else { |
|
57 | + } else { |
|
58 | 58 | throw new \Exception('Could not build Instance of \PEIP\INF\Data\Store from factory.'); |
59 | 59 | } |
60 | 60 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | throw new \Exception('loading XML failed'); |
31 | 31 | } |
32 | 32 | |
33 | - } |
|
34 | - catch (\Exception $e) { |
|
33 | + } catch (\Exception $e) { |
|
35 | 34 | return false; |
36 | 35 | } |
37 | 36 | |
@@ -65,7 +64,7 @@ discard block |
||
65 | 64 | ) |
66 | 65 | ); |
67 | 66 | } |
68 | - }else { |
|
67 | + } else { |
|
69 | 68 | $array[$name] = array(); |
70 | 69 | } |
71 | 70 | $array[$name][] = $res; |
@@ -79,7 +79,7 @@ |
||
79 | 79 | protected function doSend(\PEIP\INF\Message\Message $message) { |
80 | 80 | if ($this->capacity < 1 || $this->getMessageCount() <= $this->getCapacity()) { |
81 | 81 | $this->queue->enqueque($message); |
82 | - }else { |
|
82 | + } else { |
|
83 | 83 | throw new \Exception('Not implemented yet.'); |
84 | 84 | } |
85 | 85 | } |
@@ -60,11 +60,11 @@ |
||
60 | 60 | $message = NULL; |
61 | 61 | if ($timeout == 0) { |
62 | 62 | $message = $this->getMessage(); |
63 | - }elseif ($timeout < 0) { |
|
63 | + } elseif ($timeout < 0) { |
|
64 | 64 | while (!$message = $this->getMessage()) { |
65 | 65 | |
66 | 66 | } |
67 | - }else { |
|
67 | + } else { |
|
68 | 68 | $time = time() + $timeout; |
69 | 69 | while (($time > time()) && !$message = $this->getMessage()) { |
70 | 70 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | protected function getMessage($object) { |
18 | 18 | if ($this->channel instanceof \PEIP\INF\Channel\SubscribableChannel) { |
19 | 19 | return $object; |
20 | - }else { |
|
20 | + } else { |
|
21 | 21 | return $object->getContent()->receive(); |
22 | 22 | } |
23 | 23 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | protected function doSend(\PEIP\INF\Message\Message $message) { |
55 | 55 | if ($this->capacity < 1 || $this->getMessageCount() <= $this->getCapacity()) { |
56 | 56 | $this->queue->insert($message, $message->getHeader($this->priorityHeader)); |
57 | - }else { |
|
57 | + } else { |
|
58 | 58 | throw new \Exception('Not implemented yet.'); |
59 | 59 | } |
60 | 60 | } |
@@ -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 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $setter = self::getSetter($property); |
385 | 385 | if ($setter && self::hasPublicProperty($service, 'Method', $setter)) { |
386 | 386 | $service->{$setter}($arg); |
387 | - }elseif (in_array($property, self::hasPublicProperty($service, 'Property', $setter))) { |
|
387 | + } elseif (in_array($property, self::hasPublicProperty($service, 'Property', $setter))) { |
|
388 | 388 | $service->$setter = $arg; |
389 | 389 | } |
390 | 390 | } |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $ref = trim((string)$config['ref']); |
618 | 618 | if ($ref != '') { |
619 | 619 | $service = $this->getService($ref); |
620 | - }else { |
|
620 | + } else { |
|
621 | 621 | $service = $this->createService($config); |
622 | 622 | } |
623 | 623 | return $service; |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | protected static function getSetter($config) { |
638 | 638 | if ($config['setter']) { |
639 | 639 | $setter = (string)$config['setter']; |
640 | - }elseif ($config['name']) { |
|
640 | + } elseif ($config['name']) { |
|
641 | 641 | $setter = 'set'.ucfirst((string)$config['name']); |
642 | 642 | } |
643 | 643 | return $setter; |
@@ -653,26 +653,26 @@ discard block |
||
653 | 653 | protected function buildArg($config) { |
654 | 654 | if (trim((string)$config['value']) != '') { |
655 | 655 | $arg = (string)$config['value']; |
656 | - }elseif ($config->getName() == 'value') { |
|
656 | + } elseif ($config->getName() == 'value') { |
|
657 | 657 | $arg = (string)$config; |
658 | - }elseif ($config->getName() == 'list') { |
|
658 | + } elseif ($config->getName() == 'list') { |
|
659 | 659 | $arg = array(); |
660 | 660 | foreach ($config->children() as $entry) { |
661 | 661 | if ($entry->getName() == 'value') { |
662 | 662 | if ($entry['key']) { |
663 | 663 | $arg[(string)$entry['key']] = (string)$entry; |
664 | - }else { |
|
664 | + } else { |
|
665 | 665 | $arg[] = (string)$entry; |
666 | 666 | } |
667 | - }elseif ($entry->getName() == 'service') { |
|
667 | + } elseif ($entry->getName() == 'service') { |
|
668 | 668 | $arg[] = $this->provideService($entry); |
669 | 669 | } |
670 | 670 | } |
671 | - }elseif ($config->getName() == 'service') { |
|
671 | + } elseif ($config->getName() == 'service') { |
|
672 | 672 | $arg = $this->provideService($config); |
673 | - }elseif ($config->list) { |
|
673 | + } elseif ($config->list) { |
|
674 | 674 | $arg = $this->buildArg($config->list); |
675 | - }elseif ($config->service) { |
|
675 | + } elseif ($config->service) { |
|
676 | 676 | $arg = $this->buildArg($config->service); |
677 | 677 | } |
678 | 678 | return $arg; |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | $constructor = (string)$config["constructor"]; |
775 | 775 | if ($constructor != '') { |
776 | 776 | $service = call_user_func_array(array($cls, $constructor), $arguments); |
777 | - }else { |
|
777 | + } else { |
|
778 | 778 | $service = self::build($cls, $arguments); |
779 | 779 | } |
780 | 780 | } catch (\Exception $e) { |
@@ -114,8 +114,7 @@ |
||
114 | 114 | $this->send($content); |
115 | 115 | try { |
116 | 116 | $res = $this->receive(); |
117 | - } |
|
118 | - catch (\Exception $e) { |
|
117 | + } catch (\Exception $e) { |
|
119 | 118 | return NULL; |
120 | 119 | } |
121 | 120 | return $res; |