Completed
Push — 123 ( d13f38 )
by Vasily
05:11
created
app-examples/ExampleComplexJob.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 	 * 
15 15
 	 * @return void
16 16
 	 */
17
-    public function onReady() {
17
+	public function onReady() {
18 18
 
19
-        // Adding listener
20
-        // ComplexJob - STATE_WAITING
21
-        $job = new ComplexJob(function($job) {
22
-        	// ComplexJob - STATE_DONE
23
-            /*array (
19
+		// Adding listener
20
+		// ComplexJob - STATE_WAITING
21
+		$job = new ComplexJob(function($job) {
22
+			// ComplexJob - STATE_DONE
23
+			/*array (
24 24
               'bar' =>
25 25
               array (
26 26
                     'job' => 'bar',
@@ -44,62 +44,62 @@  discard block
 block discarded – undo
44 44
                     'line' => 94,
45 45
               ),
46 46
             )*/
47
-            Daemon::log($job->results);
48
-        });
47
+			Daemon::log($job->results);
48
+		});
49 49
 
50
-        // Adding listener
51
-        // ComplexJob - STATE_WAITING
52
-        $job->addListener(function($job) {
50
+		// Adding listener
51
+		// ComplexJob - STATE_WAITING
52
+		$job->addListener(function($job) {
53 53
 			// ComplexJob - STATE_DONE
54
-        });
54
+		});
55 55
 
56
-        // Incapsulate some property in job
57
-        $job->appInstance = $this;
56
+		// Incapsulate some property in job
57
+		$job->appInstance = $this;
58 58
 
59
-        // Adding async job foo
60
-        $job('foo', $this->foo(array('param' => 'value')));
59
+		// Adding async job foo
60
+		$job('foo', $this->foo(array('param' => 'value')));
61 61
 
62
-        // Adding with 1 sec delay
63
-        Timer::add(function($event) use ($job) {
62
+		// Adding with 1 sec delay
63
+		Timer::add(function($event) use ($job) {
64 64
 
65
-            // Adding async job bar
66
-            $job('bar', function($jobname, $job) {
67
-                Timer::add(function($event) use($jobname, $job) {
68
-                    // Job done
69
-                    $job->setResult($jobname, array('job' => 'bar', 'success' => false, 'line' => __LINE__));
70
-                    $event->finish();
71
-                }, 1e3 * 50);
72
-            });
65
+			// Adding async job bar
66
+			$job('bar', function($jobname, $job) {
67
+				Timer::add(function($event) use($jobname, $job) {
68
+					// Job done
69
+					$job->setResult($jobname, array('job' => 'bar', 'success' => false, 'line' => __LINE__));
70
+					$event->finish();
71
+				}, 1e3 * 50);
72
+			});
73 73
 
74
-            // Adding async job baz. Equal $job('baz', $job->appInstance->baz());
75
-            $job->addJob('baz', $job->appInstance->baz());
74
+			// Adding async job baz. Equal $job('baz', $job->appInstance->baz());
75
+			$job->addJob('baz', $job->appInstance->baz());
76 76
 
77
-            // Run jobs. All listeners will be called when the jobs done
78
-            // ComplexJob - STATE_RUNNING
79
-            $job();
77
+			// Run jobs. All listeners will be called when the jobs done
78
+			// ComplexJob - STATE_RUNNING
79
+			$job();
80 80
                 
81
-            $event->finish();
82
-        }, 1e6 * 1);
81
+			$event->finish();
82
+		}, 1e6 * 1);
83 83
 
84
-    }
84
+	}
85 85
 
86
-    final public function foo($arg) {
87
-        return function($jobname, $job) use ($arg) {
88
-            Timer::add(function($event) use($jobname, $job, $arg) {
89
-                // Job done
90
-                $job->setResult($jobname, array('job' => 'foo', 'success' => true, 'line' => __LINE__, 'arg' => $arg));
91
-                $event->finish();
92
-            }, 1e3 * 100);
93
-        };
94
-    }
86
+	final public function foo($arg) {
87
+		return function($jobname, $job) use ($arg) {
88
+			Timer::add(function($event) use($jobname, $job, $arg) {
89
+				// Job done
90
+				$job->setResult($jobname, array('job' => 'foo', 'success' => true, 'line' => __LINE__, 'arg' => $arg));
91
+				$event->finish();
92
+			}, 1e3 * 100);
93
+		};
94
+	}
95 95
 
96
-    final public function baz() {
97
-        return function($jobname, $job) {
98
-            Timer::add(function($event) use($jobname, $job) {
99
-                // Job done
100
-                $job->setResult($jobname, array('job' => 'baz', 'success' => false, 'line' => __LINE__));
101
-                $event->finish();
102
-            }, 1e3 * 300);
103
-        };
104
-    }
96
+	final public function baz() {
97
+		return function($jobname, $job) {
98
+			Timer::add(function($event) use($jobname, $job) {
99
+				// Job done
100
+				$job->setResult($jobname, array('job' => 'baz', 'success' => false, 'line' => __LINE__));
101
+				$event->finish();
102
+			}, 1e3 * 300);
103
+		};
104
+	}
105 105
 }
Please login to merge, or discard this patch.
lib/MemcacheClientConnection.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	 * Called when new data received
22 22
 	 * @param string New data
23 23
 	 * @return void
24
-	*/
24
+	 */
25 25
 	public function stdin($buf) {
26 26
 		$this->buf .= $buf;
27 27
 
Please login to merge, or discard this patch.
lib/XMPPRoster.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 
103 103
 		/**
104
-	 *
105
-	 * Add given contact to roster
106
-	 *
107
-	 * @param string $jid
108
-	 * @param string $subscription
109
-	 * @param string $name
110
-	 * @param array $groups
111
-	 */
104
+		 *
105
+		 * Add given contact to roster
106
+		 *
107
+		 * @param string $jid
108
+		 * @param string $subscription
109
+		 * @param string $name
110
+		 * @param array $groups
111
+		 */
112 112
 	public function _addContact($jid, $subscription, $name='', $groups=array()) {
113 113
 		$contact = array('jid' => $jid, 'subscription' => $subscription, 'name' => $name, 'groups' => $groups);
114 114
 		if ($this->isContact($jid)) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @param integer $priority
149 149
 	 * @param string $show
150 150
 	 * @param string $status
151
-	*/
151
+	 */
152 152
 	public function setPresence($presence, $priority, $show, $status) {
153 153
 		list($jid, $resource) = explode('/', $presence . '/');
154 154
 		if ($show != 'unavailable') {
Please login to merge, or discard this patch.
lib/HTTPClient.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,8 +140,8 @@
 block discarded – undo
140 140
 		foreach ($headers as $key => $item) {
141 141
 			if (is_numeric($key)) {
142 142
 				if (is_string($item)) {
143
-                    $this->writeln($item);
144
-                }
143
+					$this->writeln($item);
144
+				}
145 145
 				elseif (is_array($item)) {
146 146
 					$this->writeln($item[0].': '.$item[1]); // @TODO: prevent injections?
147 147
 				}
Please login to merge, or discard this patch.
lib/ValveClient.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 			$info['secure'] = Binary::getByte($st); 
199 199
    		}
200 200
    		elseif ($type === ValveClient::S2A_INFO_SOURCE) {
201
-    		$info['srvaddress'] = Binary::getString($st);
202
-    		$info['hostname'] = Binary::getString($st);
203
-    		$info['map'] = Binary::getString($st);
204
-    		$info['gamedir'] = Binary::getString($st);
205
-    		$info['gamedescr'] = Binary::getString($st);
201
+			$info['srvaddress'] = Binary::getString($st);
202
+			$info['hostname'] = Binary::getString($st);
203
+			$info['map'] = Binary::getString($st);
204
+			$info['gamedir'] = Binary::getString($st);
205
+			$info['gamedescr'] = Binary::getString($st);
206 206
 			$info['playersnum'] = Binary::getByte($st);
207 207
 			$info['playersmax'] = Binary::getByte($st); 
208 208
 			$info['proto'] = Binary::getByte($st);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 				$info['mod_size'] = Binary::getDWord($st);
219 219
 				$info['mod_serverside'] = Binary::getByte($st);
220 220
 				$info['mod_customdll'] = Binary::getByte($st);
221
-    		}
221
+			}
222 222
 			$info['secure'] = Binary::getByte($st);
223 223
 			$info['botsnum'] = Binary::getByte($st);
224 224
 		}
Please login to merge, or discard this patch.
lib/HTTPServer.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 	/**
63 63
 	 * Called when the worker is ready to go.
64 64
 	 * @return void
65
-	*/
65
+	 */
66 66
 	public function onReady() {
67 67
 		parent::onReady();
68 68
 		$this->WS = WebSocketServer::getInstance();
Please login to merge, or discard this patch.
lib/MongoClientAsync.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -859,9 +859,9 @@
 block discarded – undo
859 859
 		if (strpos($col, '.') === false) {
860 860
 			$col = $this->dbname . '.' . $col;
861 861
 		} else {
862
-            $collName = explode('.', $col);
863
-            $this->dbname = $collName[0];
864
-        }
862
+			$collName = explode('.', $col);
863
+			$this->dbname = $collName[0];
864
+		}
865 865
 
866 866
 		if (isset($this->collections[$col])) {
867 867
 			return $this->collections[$col];
Please login to merge, or discard this patch.
lib/RedisClientConnection.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	 * Called when new data received
25 25
 	 * @param string New data
26 26
 	 * @return void
27
-	*/
27
+	 */
28 28
 	public function stdin($buf) {
29 29
 		$this->buf .= $buf;
30 30
 		start:
Please login to merge, or discard this patch.
lib/IOStream.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
 	/**
37 37
 	 * IOStream constructor
38
- 	 * @param resource File descriptor.
38
+	 * @param resource File descriptor.
39 39
 	 * @param object AppInstance
40 40
 	 * @return void
41 41
 	 */
Please login to merge, or discard this patch.