Completed
Push — master ( 61f375...73f1c9 )
by Andrew
01:52
created
src/Driver/Userland/UserlandDaemonFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         $socket = fopen('php://fd/'.$fd, 'r');
32 32
 
33 33
         if (false === $socket) {
34
-            throw new \RuntimeException('Could not open ' . $fd);
34
+            throw new \RuntimeException('Could not open '.$fd);
35 35
         }
36 36
 
37 37
         return $this->createDaemonFromStreamSocket($kernel, $options, $socket);
Please login to merge, or discard this patch.
src/Command/DaemonRunCommand.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
         $this->driverContainer = $driverContainer;
47 47
         $this->daemon          = null;
48 48
 
49
-        $name        = $name        ?: self::DEFAULT_NAME;
49
+        $name        = $name ?: self::DEFAULT_NAME;
50 50
         $description = $description ?: self::DEFAULT_DESCRIPTION;
51 51
 
52 52
         parent::__construct($name);
53 53
 
54 54
         $this
55 55
             ->setDescription($description)
56
-            ->addOption('port',          null, InputOption::VALUE_OPTIONAL, 'TCP port to listen on (if not present, daemon will listen on FCGI_LISTENSOCK_FILENO)')
57
-            ->addOption('host',          null, InputOption::VALUE_OPTIONAL, 'TCP host to listen on')
58
-            ->addOption('fd',            null, InputOption::VALUE_OPTIONAL, 'File descriptor to listen on - defaults to FCGI_LISTENSOCK_FILENO', DaemonInterface::FCGI_LISTENSOCK_FILENO)
56
+            ->addOption('port', null, InputOption::VALUE_OPTIONAL, 'TCP port to listen on (if not present, daemon will listen on FCGI_LISTENSOCK_FILENO)')
57
+            ->addOption('host', null, InputOption::VALUE_OPTIONAL, 'TCP host to listen on')
58
+            ->addOption('fd', null, InputOption::VALUE_OPTIONAL, 'File descriptor to listen on - defaults to FCGI_LISTENSOCK_FILENO', DaemonInterface::FCGI_LISTENSOCK_FILENO)
59 59
             ->addOption('request-limit', null, InputOption::VALUE_OPTIONAL, 'The maximum number of requests to handle before shutting down')
60
-            ->addOption('memory-limit',  null, InputOption::VALUE_OPTIONAL, 'The memory limit on the daemon instance before shutting down')
61
-            ->addOption('time-limit',    null, InputOption::VALUE_OPTIONAL, 'The time limit on the daemon in seconds before shutting down')
62
-            ->addOption('auto-shutdown', null, InputOption::VALUE_NONE,     'Perform a graceful shutdown after receiving a 5XX HTTP status code')
63
-            ->addOption('driver',        null, InputOption::VALUE_OPTIONAL, 'The implementation of the FastCGI protocol to use', 'userland');
60
+            ->addOption('memory-limit', null, InputOption::VALUE_OPTIONAL, 'The memory limit on the daemon instance before shutting down')
61
+            ->addOption('time-limit', null, InputOption::VALUE_OPTIONAL, 'The time limit on the daemon in seconds before shutting down')
62
+            ->addOption('auto-shutdown', null, InputOption::VALUE_NONE, 'Perform a graceful shutdown after receiving a 5XX HTTP status code')
63
+            ->addOption('driver', null, InputOption::VALUE_OPTIONAL, 'The implementation of the FastCGI protocol to use', 'userland');
64 64
     }
65 65
 
66 66
     /**
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
         $logger = new ConsoleLogger($output);
78 78
 
79 79
         $requestLimit = $input->getOption('request-limit') ?: DaemonOptions::NO_LIMIT;
80
-        $memoryLimit  = $input->getOption('memory-limit')  ?: DaemonOptions::NO_LIMIT;
81
-        $timeLimit    = $input->getOption('time-limit')    ?: DaemonOptions::NO_LIMIT;
80
+        $memoryLimit  = $input->getOption('memory-limit') ?: DaemonOptions::NO_LIMIT;
81
+        $timeLimit    = $input->getOption('time-limit') ?: DaemonOptions::NO_LIMIT;
82 82
         $autoShutdown = $input->getOption('auto-shutdown');
83 83
 
84 84
         return new DaemonOptions([
Please login to merge, or discard this patch.
src/Driver/Userland/Connection/StreamSocketConnectionPool.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
             $readSockets = [];
136 136
         } else {
137 137
             $res = [];
138
-            foreach($read as $socket) {
138
+            foreach ($read as $socket) {
139 139
                 $res[array_search($socket, $readSockets)] = $socket;
140 140
             }
141 141
             $readSockets = $res;
Please login to merge, or discard this patch.
src/DaemonTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         if ($this->autoShutdown) {
82 82
             foreach ($statusCodes as $statusCode) {
83 83
                 if ($statusCode >= 500 && $statusCode < 600) {
84
-                    $this->flagShutdown('Automatic shutdown following status code: ' . $statusCode);
84
+                    $this->flagShutdown('Automatic shutdown following status code: '.$statusCode);
85 85
                     break;
86 86
                 }
87 87
             }
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
      */
97 97
     private function installSignalHandlers()
98 98
     {
99
-        declare (ticks = 1);
99
+        declare(ticks=1);
100 100
 
101
-        pcntl_signal(SIGINT, function () {
101
+        pcntl_signal(SIGINT, function() {
102 102
             throw new ShutdownException('Daemon shutdown requested (received SIGINT)');
103 103
         });
104 104
 
105
-        pcntl_signal(SIGALRM, function () {
105
+        pcntl_signal(SIGALRM, function() {
106 106
             throw new ShutdownException('Daemon time limit reached (received SIGALRM)');
107 107
         });
108 108
     }
Please login to merge, or discard this patch.
src/Http/Request.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -151,6 +151,10 @@
 block discarded – undo
151 151
         return $post ?: [];
152 152
     }
153 153
 
154
+    /**
155
+     * @param resource $stream
156
+     * @param string $boundary
157
+     */
154 158
     private function parseMultipartFormData($stream, $boundary) {
155 159
         $post = "";
156 160
         $files = [];
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             $this->params[strtoupper($name)] = $value;
52 52
         }
53 53
 
54
-        $this->stdin  = $stdin;
54
+        $this->stdin = $stdin;
55 55
 
56 56
         rewind($this->stdin);
57 57
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         while (!feof($stream)) {
152 152
             $getContent = $fieldName && !$inHeader;
153
-            $buffer = stream_get_line($stream, static::$bufferSize,  "\n" . ($getContent ? '--'.$boundary : ''));
153
+            $buffer = stream_get_line($stream, static::$bufferSize, "\n".($getContent ? '--'.$boundary : ''));
154 154
             $buffer = trim($buffer, "\r");
155 155
 
156 156
             // Find the empty line between headers and body
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
             if ($getContent) {
164 164
                 if ($fieldType === 'data') {
165
-                    $post .= (isset($post[0]) ? '&' : '') . $fieldName . "=" . urlencode($buffer);
165
+                    $post .= (isset($post[0]) ? '&' : '').$fieldName."=".urlencode($buffer);
166 166
                 } elseif ($fieldType === 'file' && $filename) {
167 167
                     $tmpPath = tempnam($this->getUploadDir(), 'fastcgi_upload');
168 168
                     $err = file_put_contents($tmpPath, $buffer);
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 }
296 296
 
297 297
                 $trimmedMatch = trim($part, '[]');
298
-                if ($i === $count -1) {
298
+                if ($i === $count - 1) {
299 299
                     $current[$trimmedMatch] = $data;
300 300
                 } else {
301 301
                     $current = &$current[$trimmedMatch];
Please login to merge, or discard this patch.