Completed
Push — v1.ns ( 6f7a44...3cce68 )
by Timo
03:08
created
src/Dispatcher/ClassEventDispatcher.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,10 +70,10 @@
 block discarded – undo
70 70
                      ),
71 71
                      $object
72 72
                  );
73
-            }else{
73
+            } else{
74 74
                 throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject');
75 75
             }
76
-        }else{
76
+        } else{
77 77
             throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event');
78 78
         }
79 79
     }       //put your code here
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
      * @param Callable|PEIP\INF\Handler\Handler $listener event-handler
27 27
      * @return boolean
28 28
      */
29
-    public function connect($name, $object, $listener){ 
29
+    public function connect($name, $object, $listener) { 
30 30
         $class = is_object($object) ? get_class($object) : (string)$object;
31
-        foreach(Reflection::getImplementedClassesAndInterfaces($object) as $cls){
31
+        foreach (Reflection::getImplementedClassesAndInterfaces($object) as $cls) {
32 32
             $reflection = \PEIP\Util\ReflectionPool::getInstance($class);
33 33
             parent::connect($name, $reflection, $listener);
34 34
         }
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
         return true;
37 37
     }
38 38
 
39
-    public function disconnect($name, $object, $listener){
39
+    public function disconnect($name, $object, $listener) {
40 40
         $class = is_object($object) ? get_class($object) : (string)$object;
41 41
         $res = true;
42
-        foreach(Reflection::getImplementedClassesAndInterfaces($object) as $cls){
42
+        foreach (Reflection::getImplementedClassesAndInterfaces($object) as $cls) {
43 43
             $reflection = \PEIP\Util\ReflectionPool::getInstance($class);
44 44
             $r = parent::disconnect($name, $reflection, $listener);
45
-            if(!$r){
45
+            if (!$r) {
46 46
                 $res = false;
47 47
             }
48 48
         }
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
                         ),
70 70
                         $object
71 71
                     );
72
-            }else{
72
+            }else {
73 73
                 throw new \InvalidArgumentException('instance of \PEIP\INF\Event\Event must contain subject');
74 74
             }
75
-        }else{
75
+        }else {
76 76
             throw new \InvalidArgumentException('object must be instance of \PEIP\INF\Event\Event');
77 77
         }
78 78
     }       //put your code here
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
          * @return
90 90
          * @see EventBuilder
91 91
          */
92
-    public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false){
93
-        if(!$this->hasListeners($name, ($object))){
92
+    public function buildAndNotify($name, $object, array $headers = array(), $eventClass = false, $type = false) {
93
+        if (!$this->hasListeners($name, ($object))) {
94 94
             return false;
95 95
         }
96 96
 
Please login to merge, or discard this patch.
examples/Cafe/lib/messaging/DrinkRouter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 class DrinkRouter 
7 7
 	extends Router {
8 8
 	
9
-	protected function selectChannels(Message $message){
9
+	protected function selectChannels(Message $message) {
10 10
 		$order = $message->getContent();
11
-		$channelName = $order['iced']  ? 'coldDrinks' : 'hotDrinks';
11
+		$channelName = $order['iced'] ? 'coldDrinks' : 'hotDrinks';
12 12
 		echo PEIP_LINE_SEPARATOR."DrinkRouter: routed to channel: $channelName";
13 13
 		return $channelName;
14 14
 	}	
Please login to merge, or discard this patch.
src/Data/Store.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param mixed $value the value to store
35 35
      * @return 
36 36
      */
37
-    public function setValue($key, $value){
37
+    public function setValue($key, $value) {
38 38
         return $this->offsetSet($key, $value);
39 39
     }
40 40
     
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param mixed $key the key to return value for 
46 46
      * @return mixed the value for the given key
47 47
      */
48
-    public function getValue($key){
48
+    public function getValue($key) {
49 49
         return $this->offsetGet($key, $value);
50 50
     }
51 51
   
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @param mixed $key the key to unset value for 
57 57
      * @return 
58 58
      */
59
-    public function deleteValue($key){
59
+    public function deleteValue($key) {
60 60
         return $this->offsetUnset($key);
61 61
     }
62 62
       
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @param mixed $key the key to look for a value
68 68
      * @return boolean wether a value is stored for the key
69 69
      */
70
-    public function hasValue($key){
70
+    public function hasValue($key) {
71 71
         return $this->offsetExists($key);
72 72
     }   
73 73
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      * @param array $values key/value pairs to store
79 79
      * @return 
80 80
      */
81
-    public function setValues(array $values){
81
+    public function setValues(array $values) {
82 82
         $this->values = $values;        
83 83
     }
84 84
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @access public
89 89
      * @return array stored key/value pairs
90 90
      */
91
-    public function getValues(){
91
+    public function getValues() {
92 92
         return $this->values;
93 93
     }
94 94
    
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @param $values 
101 101
      * @return 
102 102
      */
103
-    public function addValues(array $values){
103
+    public function addValues(array $values) {
104 104
         array_merge($this->values, $values);
105 105
     }   
106 106
 }
107 107
\ No newline at end of file
Please login to merge, or discard this patch.
src/ABS/Pipe/EventPipe.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
      * @param string $eventName name of the event to listen to 
39 39
      * @param \PEIP\INF\Event\Connectable $connectable instance of \PEIP\INF\Event\Connectable to listen to 
40 40
      */
41
-    protected function doListen($eventName, \PEIP\INF\Event\Connectable $connectable){
42
-        if(!$connectable->hasListener($eventName, $this)){
41
+    protected function doListen($eventName, \PEIP\INF\Event\Connectable $connectable) {
42
+        if (!$connectable->hasListener($eventName, $this)) {
43 43
             $connectable->connect($eventName, $this);
44 44
             $this->connections[spl_object_hash($connectable)] = $connectable;   
45 45
         }   
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
      * @param string $eventName name of the event to unlisten 
53 53
      * @param \PEIP\INF\Event\Connectable $connectable instance of \PEIP\INF\Event\Connectable to unlisten to 
54 54
      */
55
-    protected function doUnlisten($eventName, \PEIP\INF\Event\Connectable $connectable){
56
-        if(!$connectable->hasListener($eventName, $this)){
55
+    protected function doUnlisten($eventName, \PEIP\INF\Event\Connectable $connectable) {
56
+        if (!$connectable->hasListener($eventName, $this)) {
57 57
             $connectable->disconnect($eventName, $this);
58 58
             unset($this->connections[spl_object_hash($connectable)]);   
59 59
         }   
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @access public
66 66
      * @return array array of \PEIP\INF\Event\Connectable instances
67 67
      */
68
-    public function doGetConnected(){
68
+    public function doGetConnected() {
69 69
         return array_values($this->connections);
70 70
     }
71 71
     
Please login to merge, or discard this patch.
src/ABS/Splitter/MessageSplitter.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      * @param \PEIP\INF\Channel\Channel $outputChannel the outputs-channel 
36 36
      * @return 
37 37
      */
38
-    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = NULL){
38
+    public function __construct(\PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel = NULL) {
39 39
         $this->setInputChannel($inputChannel);
40
-        if(is_object($outputChannel)){
40
+        if (is_object($outputChannel)) {
41 41
             $this->setOutputChannel($outputChannel);    
42 42
         }   
43 43
     }           
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
      * @param \PEIP\INF\Message\Message $message message to split 
50 50
      * @return 
51 51
      */
52
-    public function doReply(\PEIP\INF\Message\Message $message){     
52
+    public function doReply(\PEIP\INF\Message\Message $message) {     
53 53
         $res = $this->split($message);      
54
-        if(is_array($res)){
55
-            foreach($res as $msg){ 
54
+        if (is_array($res)) {
55
+            foreach ($res as $msg) { 
56 56
                 $this->replyMessage($msg);
57 57
             }
58
-        }else{
58
+        }else {
59 59
             $this->replyMessage($res);
60 60
         }
61 61
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         $name = is_object($name) ? get_class($name) : (string)$name;
23 23
         if(Test::assertClassOrInterfaceExists($name)){
24 24
             parent::connect($name, $listener);
25
-        }else{
25
+        } else{
26 26
             throw new \InvalidArgumentException($name." is not an Class nor Interface");
27 27
         }
28 28
     }
Please login to merge, or discard this patch.
src/Pipe/SimpleEventPipe.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      * @param $outputChannel 
34 34
      * @return 
35 35
      */
36
-    public function __construct($eventName, \PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel){
36
+    public function __construct($eventName, \PEIP\INF\Channel\Channel $inputChannel, \PEIP\INF\Channel\Channel $outputChannel) {
37 37
         $this->setEventName($eventName);
38 38
         $this->setInputChannel($inputChannel);
39 39
         $this->setOutputChannel($outputChannel);        
Please login to merge, or discard this patch.
src/Selector/ContentTypeSelector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @param $type 
48 48
      * @return 
49 49
      */
50
-    public function __construct($type){
50
+    public function __construct($type) {
51 51
         $this->type = $type;
52 52
     }       
53 53
             
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param $message 
58 58
      * @return 
59 59
      */
60
-    public function acceptMessage(\PEIP\INF\Message\Message $message){
60
+    public function acceptMessage(\PEIP\INF\Message\Message $message) {
61 61
         return call_user_func(self::$types[$this->type], $message->getContent());
62 62
     }           
63 63
     
Please login to merge, or discard this patch.
src/Dispatcher/Dispatcher.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param Callable|PEIP\INF\Handler\Handler  $listener
41 41
      * @return void
42 42
      */
43
-    public function connect($listener){
43
+    public function connect($listener) {
44 44
         Test::ensureHandler($listener);
45 45
         $this->listeners[] = $listener;
46 46
     }
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
      * @param Callable|PEIP\INF\Handler\Handler $listener
53 53
      * @return void
54 54
      */
55
-    public function disconnect($listener){
55
+    public function disconnect($listener) {
56 56
         Test::ensureHandler($listener);
57
-        foreach ($this->listeners as $i => $callable){
58
-            if ($listener === $callable){
57
+        foreach ($this->listeners as $i => $callable) {
58
+            if ($listener === $callable) {
59 59
                 unset($this->listeners[$i]);
60 60
             }
61 61
         }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param Callable|PEIP\INF\Handler\Handler $listener
69 69
      * @return void
70 70
      */
71
-    public function disconnectAll(){
71
+    public function disconnectAll() {
72 72
         $this->listeners = array();
73 73
     }
74 74
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
      * @access public
79 79
      * @return boolean wether any listeners are registered
80 80
      */
81
-    public function hasListeners(){
82
-        return (boolean) count($this->listeners);
81
+    public function hasListeners() {
82
+        return (boolean)count($this->listeners);
83 83
     }
84 84
     
85 85
     /**
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
      * @param mixed $subject the subject
90 90
      * @return void
91 91
      */
92
-    public function notify($subject){
92
+    public function notify($subject) {
93 93
         $res = NULL;
94
-        if($this->hasListeners()){
94
+        if ($this->hasListeners()) {
95 95
             $res = self::doNotify($this->getListeners(), $subject); 
96 96
         }   
97 97
         return $res;      
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
      * @param mixed $subject the subject 
105 105
      * @return \PEIP\INF\Handler\Handler the listener which returned a boolean true value
106 106
      */
107
-    public function notifyUntil($subject){
108
-        if($this->hasListeners()){
107
+    public function notifyUntil($subject) {
108
+        if ($this->hasListeners()) {
109 109
             $res = self::doNotifyUntil($this->getListeners(), $subject);    
110 110
         }
111 111
         return $res;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * @access public
118 118
      * @return array the listeners
119 119
      */
120
-    public function getListeners(){
120
+    public function getListeners() {
121 121
         return $this->listeners;
122 122
     }
123 123
 
Please login to merge, or discard this patch.
src/Util/Reflection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
      * @return array array with interface/class info for the class
31 31
      */
32 32
 
33
-    public static function getImplementedClassesAndInterfaces($class, $store = true){
33
+    public static function getImplementedClassesAndInterfaces($class, $store = true) {
34 34
         $class = is_object($class) ? get_class($class) : (string)$class;
35
-        if(isset(self::$classInfo[$class])){
35
+        if (isset(self::$classInfo[$class])) {
36 36
             return self::$classInfo[$class];
37 37
         }
38 38
         $cls = ReflectionPool::getInstance($class);
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $classInfo = (array)$cls->getInterfaceNames();
41 41
         $classInfo[] = $cls->getName();
42 42
         // get names of parent-classes
43
-        while($cls = $cls->getParentClass()){
43
+        while ($cls = $cls->getParentClass()) {
44 44
             $classInfo[] = $cls->getName();
45 45
         }
46 46
         
Please login to merge, or discard this patch.