Completed
Push — v1.ns ( a6bb16...dc5273 )
by Timo
03:36
created
examples/Cafe/misc/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 require_once(dirname(__FILE__).'/../../../misc/bootstrap.php');
4 4
 
5
-foreach (glob(realpath(dirname(__FILE__)."/../lib/model/")."/*.php") as $filename){
5
+foreach (glob(realpath(dirname(__FILE__)."/../lib/model/")."/*.php") as $filename) {
6 6
     require_once $filename;
7 7
 }
8 8
 
9
-foreach (glob(realpath(dirname(__FILE__)."/../lib/messaging/")."/*.php") as $filename){
9
+foreach (glob(realpath(dirname(__FILE__)."/../lib/messaging/")."/*.php") as $filename) {
10 10
     require_once $filename;
11 11
 }
12 12
 
Please login to merge, or discard this patch.
examples/Cafe/lib/messaging/CafeGateway.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
 class CafeGateway extends SimpleMessagingGateway {
6 6
 
7
-	public function placeOrder(Order $order){
8
-		echo "\nCafe: place order #".$order->getOrderNumber();
9
-		$this->send($order);
10
-	}
7
+    public function placeOrder(Order $order){
8
+        echo "\nCafe: place order #".$order->getOrderNumber();
9
+        $this->send($order);
10
+    }
11 11
 	
12
-	public function receiveDelivery(){
13
-		return $this->receive();
14
-	}
12
+    public function receiveDelivery(){
13
+        return $this->receive();
14
+    }
15 15
 
16 16
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@
 block discarded – undo
4 4
 
5 5
 class CafeGateway extends SimpleMessagingGateway {
6 6
 
7
-	public function placeOrder(Order $order){
7
+	public function placeOrder(Order $order) {
8 8
 		echo "\nCafe: place order #".$order->getOrderNumber();
9 9
 		$this->send($order);
10 10
 	}
11 11
 	
12
-	public function receiveDelivery(){
12
+	public function receiveDelivery() {
13 13
 		return $this->receive();
14 14
 	}
15 15
 
Please login to merge, or discard this patch.
examples/Cafe/lib/messaging/DrinkAggregator.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -4,38 +4,38 @@
 block discarded – undo
4 4
 use PEIP\INF\Message\Message;
5 5
 
6 6
 class DrinkAggregator 
7
-	extends \PEIP\Pipe\Pipe {
7
+    extends \PEIP\Pipe\Pipe {
8 8
 
9
-	protected $orders = array();
10
-	protected $preparedDrinks = array();
9
+    protected $orders = array();
10
+    protected $preparedDrinks = array();
11 11
 	
12
-	public function __construct(Channel $inputChannel, Channel $outputChannel = NULL){
13
-		$this->setInputChannel($inputChannel);
14
-		if(is_object($outputChannel)){
15
-			$this->setOutputChannel($outputChannel);	
16
-		}
17
-		$this->registerCommand('ADD_ORDER', array($this, 'receiveOrder'));
18
-	}
12
+    public function __construct(Channel $inputChannel, Channel $outputChannel = NULL){
13
+        $this->setInputChannel($inputChannel);
14
+        if(is_object($outputChannel)){
15
+            $this->setOutputChannel($outputChannel);	
16
+        }
17
+        $this->registerCommand('ADD_ORDER', array($this, 'receiveOrder'));
18
+    }
19 19
 
20
-	protected function doReply(Message $message){
21
-		$drink = $message->getContent();
22
-		$nr = $drink->getOrderNumber();
23
-		if(!isset($this->preparedDrinks[$nr])){
24
-			$this->preparedDrinks[$nr] = array();
25
-		}
26
-		$this->preparedDrinks[$drink->getOrderNumber()][] = $drink;
27
-		if(isset($this->orders[$nr]) 
28
-			&& $this->orders[$nr]->getTotalCount() == count($this->preparedDrinks[$nr])){
29
-			$this->replyMessage($this->preparedDrinks[$nr]);
30
-			unset($this->preparedDrinks[$nr]);
31
-			echo PEIP_LINE_SEPARATOR.'DrinkAggregator : reply #'.$nr;	
32
-		}
33
-	}
20
+    protected function doReply(Message $message){
21
+        $drink = $message->getContent();
22
+        $nr = $drink->getOrderNumber();
23
+        if(!isset($this->preparedDrinks[$nr])){
24
+            $this->preparedDrinks[$nr] = array();
25
+        }
26
+        $this->preparedDrinks[$drink->getOrderNumber()][] = $drink;
27
+        if(isset($this->orders[$nr]) 
28
+            && $this->orders[$nr]->getTotalCount() == count($this->preparedDrinks[$nr])){
29
+            $this->replyMessage($this->preparedDrinks[$nr]);
30
+            unset($this->preparedDrinks[$nr]);
31
+            echo PEIP_LINE_SEPARATOR.'DrinkAggregator : reply #'.$nr;	
32
+        }
33
+    }
34 34
 
35
-	public function receiveOrder(Order $order){
36
-		echo PEIP_LINE_SEPARATOR.'DrinkAggregator: received Order';
37
-		$this->orders[$order->getOrderNumber()] = $order;	
38
-	}	
35
+    public function receiveOrder(Order $order){
36
+        echo PEIP_LINE_SEPARATOR.'DrinkAggregator: received Order';
37
+        $this->orders[$order->getOrderNumber()] = $order;	
38
+    }	
39 39
 	
40 40
 
41 41
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,30 +9,30 @@
 block discarded – undo
9 9
 	protected $orders = array();
10 10
 	protected $preparedDrinks = array();
11 11
 	
12
-	public function __construct(Channel $inputChannel, Channel $outputChannel = NULL){
12
+	public function __construct(Channel $inputChannel, Channel $outputChannel = NULL) {
13 13
 		$this->setInputChannel($inputChannel);
14
-		if(is_object($outputChannel)){
14
+		if (is_object($outputChannel)) {
15 15
 			$this->setOutputChannel($outputChannel);	
16 16
 		}
17 17
 		$this->registerCommand('ADD_ORDER', array($this, 'receiveOrder'));
18 18
 	}
19 19
 
20
-	protected function doReply(Message $message){
20
+	protected function doReply(Message $message) {
21 21
 		$drink = $message->getContent();
22 22
 		$nr = $drink->getOrderNumber();
23
-		if(!isset($this->preparedDrinks[$nr])){
23
+		if (!isset($this->preparedDrinks[$nr])) {
24 24
 			$this->preparedDrinks[$nr] = array();
25 25
 		}
26 26
 		$this->preparedDrinks[$drink->getOrderNumber()][] = $drink;
27
-		if(isset($this->orders[$nr]) 
28
-			&& $this->orders[$nr]->getTotalCount() == count($this->preparedDrinks[$nr])){
27
+		if (isset($this->orders[$nr]) 
28
+			&& $this->orders[$nr]->getTotalCount() == count($this->preparedDrinks[$nr])) {
29 29
 			$this->replyMessage($this->preparedDrinks[$nr]);
30 30
 			unset($this->preparedDrinks[$nr]);
31 31
 			echo PEIP_LINE_SEPARATOR.'DrinkAggregator : reply #'.$nr;	
32 32
 		}
33 33
 	}
34 34
 
35
-	public function receiveOrder(Order $order){
35
+	public function receiveOrder(Order $order) {
36 36
 		echo PEIP_LINE_SEPARATOR.'DrinkAggregator: received Order';
37 37
 		$this->orders[$order->getOrderNumber()] = $order;	
38 38
 	}	
Please login to merge, or discard this patch.
examples/Cafe/lib/messaging/DrinkRouter.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 use PEIP\INF\Message\Message;
5 5
 
6 6
 class DrinkRouter 
7
-	extends Router {
7
+    extends Router {
8 8
 	
9
-	protected function selectChannels(Message $message){
10
-		$order = $message->getContent();
11
-		$channelName = $order['iced']  ? 'coldDrinks' : 'hotDrinks';
12
-		echo PEIP_LINE_SEPARATOR."DrinkRouter: routed to channel: $channelName";
13
-		return $channelName;
14
-	}	
9
+    protected function selectChannels(Message $message){
10
+        $order = $message->getContent();
11
+        $channelName = $order['iced']  ? 'coldDrinks' : 'hotDrinks';
12
+        echo PEIP_LINE_SEPARATOR."DrinkRouter: routed to channel: $channelName";
13
+        return $channelName;
14
+    }	
15 15
 
16 16
 	
17 17
 }
Please login to merge, or discard this 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.
examples/Cafe/lib/messaging/OrderSplitter.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@
 block discarded – undo
5 5
 
6 6
 class OrderSplitter extends MessageSplitter {
7 7
 
8
-	public function split(Message $message){
9
-		$order = $message->getContent();
10
-		$orderItems = $order->getItems();
11
-		$items = array();
12
-		foreach($orderItems as $item){
13
-			$nr = $item['number'];
14
-			unset($item['number']);
15
-			$item['order'] = $order->getOrderNumber();
16
-			for($x = 0; $x < $nr; $x++){
17
-				$items[] = $item;	
18
-			}
19
-		}
20
-		echo PEIP_LINE_SEPARATOR."OrderSplitter: split order #: ".$order->getOrderNumber();
21
-		return $items;
22
-	}
8
+    public function split(Message $message){
9
+        $order = $message->getContent();
10
+        $orderItems = $order->getItems();
11
+        $items = array();
12
+        foreach($orderItems as $item){
13
+            $nr = $item['number'];
14
+            unset($item['number']);
15
+            $item['order'] = $order->getOrderNumber();
16
+            for($x = 0; $x < $nr; $x++){
17
+                $items[] = $item;	
18
+            }
19
+        }
20
+        echo PEIP_LINE_SEPARATOR."OrderSplitter: split order #: ".$order->getOrderNumber();
21
+        return $items;
22
+    }
23 23
 	
24 24
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,15 +5,15 @@
 block discarded – undo
5 5
 
6 6
 class OrderSplitter extends MessageSplitter {
7 7
 
8
-	public function split(Message $message){
8
+	public function split(Message $message) {
9 9
 		$order = $message->getContent();
10 10
 		$orderItems = $order->getItems();
11 11
 		$items = array();
12
-		foreach($orderItems as $item){
12
+		foreach ($orderItems as $item) {
13 13
 			$nr = $item['number'];
14 14
 			unset($item['number']);
15 15
 			$item['order'] = $order->getOrderNumber();
16
-			for($x = 0; $x < $nr; $x++){
16
+			for ($x = 0; $x < $nr; $x++) {
17 17
 				$items[] = $item;	
18 18
 			}
19 19
 		}
Please login to merge, or discard this patch.
examples/Cafe/lib/model/Cafe.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 class Cafe 
4
-	extends \PEIP\Gateway\SimpleMessagingGateway {
4
+    extends \PEIP\Gateway\SimpleMessagingGateway {
5 5
 
6
-	public function placeOrder(Order $order){
7
-		return $this->sendAndReceive($order);	
8
-	}
6
+    public function placeOrder(Order $order){
7
+        return $this->sendAndReceive($order);	
8
+    }
9 9
 
10 10
 }
11 11
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 class Cafe 
4 4
 	extends \PEIP\Gateway\SimpleMessagingGateway {
5 5
 
6
-	public function placeOrder(Order $order){
6
+	public function placeOrder(Order $order) {
7 7
 		return $this->sendAndReceive($order);	
8 8
 	}
9 9
 
Please login to merge, or discard this patch.
examples/HelloWorld/hello_world_scripted.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 // simple service class
10 10
 class HelloService {
11 11
 
12
-	public function greet($name){
13
-		return 'Hello '.$name;
14
-	}
12
+    public function greet($name){
13
+        return 'Hello '.$name;
14
+    }
15 15
 
16 16
 }
17 17
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 // simple service class
10 10
 class HelloService {
11 11
 
12
-	public function greet($name){
12
+	public function greet($name) {
13 13
 		return 'Hello '.$name;
14 14
 	}
15 15
 
Please login to merge, or discard this patch.
src/Data/ArrayAccess.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      * @param mixed $offset the offset  
33 33
      * @return 
34 34
      */
35
-    public function offsetExists($offset){
35
+    public function offsetExists($offset) {
36 36
         return array_key_exists($name, $this->values);
37 37
     }   
38 38
        
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param mixed $offset the offset 
44 44
      * @return 
45 45
      */
46
-    public function offsetGet($offset){
46
+    public function offsetGet($offset) {
47 47
         return array_key_exists($name, $this->values) ? $this->values[$offset] : NULL;
48 48
     }
49 49
      
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      * @param mixed $offset the offset 
55 55
      * @return 
56 56
      */
57
-    public function offsetUnset($offset){
57
+    public function offsetUnset($offset) {
58 58
         unset($this->values[$offset]);
59 59
     }   
60 60
   
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @param mixed $value value for the offset 
67 67
      * @return 
68 68
      */
69
-    public function offsetSet($offset, $value){
69
+    public function offsetSet($offset, $value) {
70 70
         $this->values[$offset] = $value;
71 71
     }
72 72
 
Please login to merge, or discard this patch.
src/Service/SplittingServiceActivator.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@
 block discarded – undo
33 33
      * @param \PEIP\INF\Message\Message $message message to call the service with it�s content/payload
34 34
      * @return mixed result of calling the registered service callable with message content/payload
35 35
      */
36
-    public function callService(\PEIP\INF\Message\Message $message){
37
-        if(is_callable($this->serviceCallable)){
36
+    public function callService(\PEIP\INF\Message\Message $message) {
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;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.