Completed
Push — master ( 0a7c70...27da95 )
by Ron
03:44
created
Category
src/AttributeRepositories/SqliteAttributeRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function store($key, $timeout, array $data = array()) {
63 63
 		$key = trim(strtolower($key));
64
-		if(!in_array($key, $this->services)) {
64
+		if (!in_array($key, $this->services)) {
65 65
 			$this->services[] = $key;
66 66
 		} else {
67 67
 			throw new Exception("Duplicate service: {$key}");
68 68
 		}
69 69
 
70
-		if($this->has($key)) {
70
+		if ($this->has($key)) {
71 71
 			$this->updateService->bindValue('key', $key);
72 72
 			$this->updateService->bindValue('timeout', $timeout);
73 73
 			$this->updateService->execute();
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		$this->selectServices->execute();
110 110
 		$services = $this->selectServices->fetchAll(PDO::FETCH_ASSOC);
111 111
 		$result = array();
112
-		foreach($services as $service) {
112
+		foreach ($services as $service) {
113 113
 			$result[] = $service['service_key'];
114 114
 		}
115 115
 		$this->selectServices->closeCursor();
Please login to merge, or discard this patch.
src/Dispatchers/DefaultDispatcher.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 * @return $this
52 52
 	 */
53 53
 	public function on($event, $fn) {
54
-		if(!array_key_exists($event, $this->listeners)) {
54
+		if (!array_key_exists($event, $this->listeners)) {
55 55
 			$this->listeners[$event] = array();
56 56
 		}
57 57
 		$this->listeners[$event][] = $fn;
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 	public function run() {
66 66
 		$services = $this->attributeRepository->fetchServices();
67 67
 		$count = 0;
68
-		foreach($services as $service) {
69
-			if(!array_key_exists($service, $this->services)) {
68
+		foreach ($services as $service) {
69
+			if (!array_key_exists($service, $this->services)) {
70 70
 				continue;
71 71
 			}
72
-			if(array_key_exists($service, $this->standardTimeouts)) {
72
+			if (array_key_exists($service, $this->standardTimeouts)) {
73 73
 				$standardTimeout = $this->standardTimeouts[$service];
74 74
 			} else {
75 75
 				$standardTimeout = 0;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			try {
82 82
 				$this->fireEvent('service-start', $eventParams);
83 83
 				$this->attributeRepository->markTry($service);
84
-				if($this->methodInvoker !== null) {
84
+				if ($this->methodInvoker !== null) {
85 85
 					$this->methodInvoker->invoke($this->services[$service], $eventParams);
86 86
 				} else {
87 87
 					call_user_func($this->services[$service], $service);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 			} catch (\Exception $e) {
93 93
 				$eventParams['exception'] = $e;
94 94
 				$this->fireEvent('service-failure', $eventParams);
95
-				if($this->logger !== null) {
95
+				if ($this->logger !== null) {
96 96
 					$this->logger->critical("{$service}: {$e->getMessage()}", array('exception' => $e));
97 97
 				} else {
98 98
 					throw new Exception("{$service}: {$e->getMessage()}", $e->getCode(), $e);
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
 	 * @param array $params
108 108
 	 */
109 109
 	private function fireEvent($event, $params) {
110
-		if(array_key_exists($event, $this->listeners)) {
110
+		if (array_key_exists($event, $this->listeners)) {
111 111
 			try {
112
-				foreach($this->listeners[$event] as $listener) {
112
+				foreach ($this->listeners[$event] as $listener) {
113 113
 					$this->methodInvoker->invoke($listener, $params);
114 114
 				}
115 115
 			} catch (Exception $e) {
116 116
 				// Supress exceptions emitted by events
117
-				if($this->logger !== null) {
117
+				if ($this->logger !== null) {
118 118
 					$this->logger->critical($e->getMessage(), array('exception' => $e));
119 119
 				}
120 120
 			}
Please login to merge, or discard this patch.
src/Dispatchers/DefaultDispatcher/Service.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 		$lastRunTime = clone $this->getAttributes()->getLastRunTime();
46 46
 		$lastRunTime->modify("+{$this->interval} seconds");
47 47
 		$lastRunTime->setTimezone(new DateTimeZone('UTC'));
48
-		return ;
48
+		return;
49 49
 	}
50 50
 
51 51
 	/**
Please login to merge, or discard this patch.