Completed
Push — 123 ( d13f38 )
by Vasily
05:11
created
app-examples/Example.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	 * Setting default config options
15 15
 	 * Overriden from AppInstance::getConfigDefaults
16 16
 	 * Uncomment and return array with your default options
17
-	 * @return array|false
17
+	 * @return boolean
18 18
 	 */
19 19
 	protected function getConfigDefaults() {
20 20
 		return false;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * Creates Request.
49 49
 	 * @param object Request.
50 50
 	 * @param object Upstream application instance.
51
-	 * @return object Request.
51
+	 * @return ExampleRequest Request.
52 52
 	 */
53 53
 	public function beginRequest($req, $upstream) {
54 54
 		return new ExampleRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 $user = posix_getpwuid(posix_getuid());
86 86
 $group = posix_getgrgid(posix_getgid());
87 87
 ?>
88
-<br />My user/group: <?php echo $user['name'].'/'.$group['name']; ?>
88
+<br />My user/group: <?php echo $user['name'] . '/' . $group['name']; ?>
89 89
 <?php
90 90
 $displaystate = TRUE;
91 91
 
Please login to merge, or discard this patch.
app-examples/ExampleDNSClient.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	 * Creates Request.
12 12
 	 * @param object Request.
13 13
 	 * @param object Upstream application instance.
14
-	 * @return object Request.
14
+	 * @return ExampleDNSClientRequest Request.
15 15
 	 */
16 16
 	public function beginRequest($req, $upstream) {
17 17
 		return new ExampleDNSClientRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 	 * @return integer Status.
59 59
 	 */
60 60
 	public function run() {		
61
-		try {$this->header('Content-Type: text/plain');} catch (Exception $e) {}
61
+		try {$this->header('Content-Type: text/plain'); } catch (Exception $e) {}
62 62
 		var_dump($this->job->getResult('query'));
63 63
 		var_dump($this->job->getResult('resolve'));
64 64
 	}
Please login to merge, or discard this patch.
app-examples/ExampleFs.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	 * Creates Request.
12 12
 	 * @param object Request.
13 13
 	 * @param object Upstream application instance.
14
-	 * @return object Request.
14
+	 * @return ExampleFsRequest Request.
15 15
 	 */
16 16
 	public function beginRequest($req, $upstream) {
17 17
 		return new ExampleFsRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	public function init() {
24 24
 		$req = $this;
25 25
 		$this->sleep(1, true);
26
-		FS::readfile('/etc/filesystems', function ($file, $data) use ($req) {
26
+		FS::readfile('/etc/filesystems', function($file, $data) use ($req) {
27 27
 			$req->fileData = $data;
28 28
 			$req->wakeup();
29 29
 		});
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 */
36 36
 	public function run() {
37 37
 		$this->header('Content-Type: text/plain');
38
-		echo "Contents of /etc/filesystems:\n". $this->fileData;
38
+		echo "Contents of /etc/filesystems:\n" . $this->fileData;
39 39
 	}
40 40
 	
41 41
 }
Please login to merge, or discard this patch.
app-examples/ExampleHTTPClient.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	 * Creates Request.
39 39
 	 * @param object Request.
40 40
 	 * @param object Upstream application instance.
41
-	 * @return object Request.
41
+	 * @return ExampleHTTPClientRequest Request.
42 42
 	 */
43 43
 	public function beginRequest($req, $upstream) {
44 44
 		return new ExampleHTTPClientRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 	 */
55 55
 	public function init() {
56 56
 
57
-		try {$this->header('Content-Type: text/html');} catch (Exception $e) {}
57
+		try {$this->header('Content-Type: text/html'); } catch (Exception $e) {}
58 58
 
59 59
 			$this->appInstance->httpclient->post(
60 60
 				['http://phpdaemon.net/Example/', 'foo' => 'bar'], ['postField' => 'value'],
Please login to merge, or discard this patch.
app-examples/ExampleICMP.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	 * Creates Request.
12 12
 	 * @param object Request.
13 13
 	 * @param object Upstream application instance.
14
-	 * @return object Request.
14
+	 * @return ExampleICMPRequest Request.
15 15
 	 */
16 16
 	public function beginRequest($req, $upstream) {
17 17
 		return new ExampleICMPRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 				
36 36
 		$job('pingjob', function($name, $job) use ($req) { // registering job named 'pingjob'
37 37
 		
38
-			ICMPClient::getInstance()->sendPing('8.8.8.8', function ($latency) use ($name, $job) {
38
+			ICMPClient::getInstance()->sendPing('8.8.8.8', function($latency) use ($name, $job) {
39 39
 				$job->setResult($name, $latency); 	
40 40
 			});
41 41
 		});
Please login to merge, or discard this patch.
app-examples/ExamplePubSub.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 	 * Creates Request.
45 45
 	 * @param object Request.
46 46
 	 * @param object Upstream application instance.
47
-	 * @return object Request.
47
+	 * @return ExamplePubSubTestPageRequest Request.
48 48
 	 */
49 49
 	public function beginRequest($req, $upstream) {
50 50
 		return new ExamplePubSubTestPageRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 	 */
9 9
 	public function onReady() {
10 10
 		$appInstance = $this; // a reference to this application instance for ExampleWebSocketRoute
11
-		WebSocketServer::getInstance()->addRoute('ExamplePubSub', function ($client) use ($appInstance) {
11
+		WebSocketServer::getInstance()->addRoute('ExamplePubSub', function($client) use ($appInstance) {
12 12
 			return new ExamplePubSubWebSocketRoute($client, $appInstance);
13 13
 		});
14 14
 		$this->sql = MySQLClient::getInstance();
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 					return;
22 22
 				}
23 23
 				$pubsub->event = setTimeout(function($timer) use ($pubsub, $appInstance) {
24
-					$appInstance->sql->getConnection(function ($sql) use ($pubsub) {
24
+					$appInstance->sql->getConnection(function($sql) use ($pubsub) {
25 25
 						if (!$sql->connected) {
26 26
 							return;
27 27
 						}
28
-						$sql->query('SELECT COUNT(*) `num` FROM `dle_users`', function ($sql, $success) use ($pubsub) {
28
+						$sql->query('SELECT COUNT(*) `num` FROM `dle_users`', function($sql, $success) use ($pubsub) {
29 29
 							$pubsub->pub(sizeof($sql->resultRows) ? $sql->resultRows[0]['num'] : 'null');
30 30
 						});
31 31
 					});
32 32
 					$timer->timeout(5e6); // 5 seconds
33 33
 				}, 0);
34 34
 			})
35
-			->onDeactivation(function ($pubsub) {
35
+			->onDeactivation(function($pubsub) {
36 36
 				if (isset($pubsub->event)) {
37 37
 					Timer::cancelTimeout($pubsub->event);
38 38
 				}
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		$req = json_decode($data, true);
65 65
 		if ($req['type'] === 'subscribe') {
66 66
 			$eventName = $req['event'];
67
-			$this->appInstance->pubsub->sub($req['event'], $this, function ($data) use ($ws, $eventName) {
67
+			$this->appInstance->pubsub->sub($req['event'], $this, function($data) use ($ws, $eventName) {
68 68
 				$ws->sendObject(array(
69 69
 					'type' => 'event',
70 70
 					'event' => $eventName,
Please login to merge, or discard this patch.
app-examples/ExampleSandbox.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	 * Creates Request.
39 39
 	 * @param object Request.
40 40
 	 * @param object Upstream application instance.
41
-	 * @return object Request.
41
+	 * @return ExampleSandboxRequest Request.
42 42
 	 */
43 43
 	public function beginRequest($req, $upstream) {
44 44
 		return new ExampleSandboxRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,10 +62,10 @@
 block discarded – undo
62 62
 			'allow_url_fopen'  => 'false',
63 63
 			'disable_functions'=>'exec,shell_exec,passthru,system',
64 64
 			'disable_classes'  => '',
65
-			'output_handler'   => array($this,'out')
65
+			'output_handler'   => array($this, 'out')
66 66
 		));
67 67
 
68
-		$sandbox->ini_set('html_errors',true);
68
+		$sandbox->ini_set('html_errors', true);
69 69
 		$sandbox->call_user_func(function() {
70 70
 			echo "Hello World!";
71 71
 		});
Please login to merge, or discard this patch.
app-examples/ExampleWebSocket.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	 * Creates Request.
24 24
 	 * @param object Request.
25 25
 	 * @param object Upstream application instance.
26
-	 * @return object Request.
26
+	 * @return ExampleWebSocketTestPageRequest Request.
27 27
 	 */
28 28
 	public function beginRequest($req, $upstream) {
29 29
 		return new ExampleWebSocketTestPageRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	public function onReady() {
15 15
 		$appInstance = $this; // a reference to this application instance for ExampleWebSocketRoute
16 16
 		// URI /exampleApp should be handled by ExampleWebSocketRoute
17
-		WebSocketServer::getInstance()->addRoute('exampleApp', function ($client) use ($appInstance) {
17
+		WebSocketServer::getInstance()->addRoute('exampleApp', function($client) use ($appInstance) {
18 18
 			return new ExampleWebSocketRoute($client, $appInstance);
19 19
 		});
20 20
 	}
Please login to merge, or discard this patch.
app-examples/ExampleWithMemcache.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	 * Creates Request.
12 12
 	 * @param object Request.
13 13
 	 * @param object Upstream application instance.
14
-	 * @return object Request.
14
+	 * @return ExampleWithMemcacheRequest Request.
15 15
 	 */
16 16
 	public function beginRequest($req, $upstream) {
17 17
 		return new ExampleWithMemcacheRequest($this, $upstream, $req);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @return void
29 29
 	 */
30 30
 	public function init() {
31
-		try {$this->header('Content-Type: text/html');} catch (Exception $e) {}
31
+		try {$this->header('Content-Type: text/html'); } catch (Exception $e) {}
32 32
 		$req = $this;
33 33
 		
34 34
 		$job = $this->job = new ComplexJob(function() use ($req) { // called when job is done
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 } else {
74 74
 	echo '<h1>Something went wrong! We have no result.</h1>';
75 75
 }
76
-echo '<br />Request (http) took: '.round(microtime(TRUE) - $this->attrs->server['REQUEST_TIME_FLOAT'],6);
76
+echo '<br />Request (http) took: ' . round(microtime(TRUE) - $this->attrs->server['REQUEST_TIME_FLOAT'], 6);
77 77
 ?>
78 78
 </body>
79 79
 </html>
Please login to merge, or discard this patch.