@@ -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; |
@@ -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 | |
@@ -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; |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |