Passed
Pull Request — master (#661)
by Maxim
07:57
created
src/Framework/Bootloader/Http/HttpBootloader.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -82,12 +82,15 @@  discard block
 block discarded – undo
82 82
             $kernel->addDispatcher($factory->make(SapiDispatcher::class));
83 83
         });
84 84
 
85
-        if (!class_exists('Spiral\RoadRunnerBridge\Http\Dispatcher')) {
86
-            if (class_exists(PSR7Client::class)) {
85
+        if (!class_exists('Spiral\RoadRunnerBridge\Http\Dispatcher'))
86
+        {
87
+            if (class_exists(PSR7Client::class))
88
+            {
87 89
                 $kernel->addDispatcher($factory->make(LegacyRrDispatcher::class));
88 90
             }
89 91
 
90
-            if (class_exists(PSR7Worker::class)) {
92
+            if (class_exists(PSR7Worker::class))
93
+            {
91 94
                 $kernel->addDispatcher($factory->make(RrDispatcher::class));
92 95
             }
93 96
         }
@@ -131,7 +134,8 @@  discard block
 block discarded – undo
131 134
     {
132 135
         $emitter = new SapiEmitter();
133 136
 
134
-        if (($chunkSize = $config->getChunkSize()) !== null) {
137
+        if (($chunkSize = $config->getChunkSize()) !== null)
138
+        {
135 139
             $emitter->bufferSize = $chunkSize;
136 140
         }
137 141
 
Please login to merge, or discard this patch.
src/Http/src/Config/HttpConfig.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function getChunkSize(): ?int
60 60
     {
61
-        if (\is_null($this->config['chunkSize']) || (int) $this->config['chunkSize'] < 0) {
61
+        if (\is_null($this->config['chunkSize']) || (int) $this->config['chunkSize'] < 0)
62
+        {
62 63
             return null;
63 64
         }
64 65
 
Please login to merge, or discard this patch.
src/Http/src/Emitter/SapiEmitter.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -54,16 +54,20 @@  discard block
 block discarded – undo
54 54
     private function emitBody(ResponseInterface $response): void
55 55
     {
56 56
         $body = $response->getBody();
57
-        if ($body->isSeekable()) {
57
+        if ($body->isSeekable())
58
+        {
58 59
             $body->rewind();
59 60
         }
60
-        if (!$body->isReadable()) {
61
+        if (!$body->isReadable())
62
+        {
61 63
             return;
62 64
         }
63
-        if ($this->bufferSize === 0) {
65
+        if ($this->bufferSize === 0)
66
+        {
64 67
             echo $body;
65 68
         }
66
-        while (!$body->eof()) {
69
+        while (!$body->eof())
70
+        {
67 71
             echo $body->read($this->bufferSize);
68 72
             flush();
69 73
         }
@@ -80,11 +84,13 @@  discard block
 block discarded – undo
80 84
      */
81 85
     private function assertNoPreviousOutput(): void
82 86
     {
83
-        if (headers_sent()) {
87
+        if (headers_sent())
88
+        {
84 89
             throw new EmitterException('Unable to emit response, headers already send.');
85 90
         }
86 91
 
87
-        if (ob_get_level() > 0 && ob_get_length() > 0) {
92
+        if (ob_get_level() > 0 && ob_get_length() > 0)
93
+        {
88 94
             throw new EmitterException('Unable to emit response, found non closed buffered output.');
89 95
         }
90 96
     }
@@ -128,10 +134,12 @@  discard block
 block discarded – undo
128 134
     {
129 135
         $statusCode = $response->getStatusCode();
130 136
 
131
-        foreach ($response->getHeaders() as $header => $values) {
137
+        foreach ($response->getHeaders() as $header => $values)
138
+        {
132 139
             $name = $this->filterHeader($header);
133 140
             $first = $name === 'Set-Cookie' ? false : true;
134
-            foreach ($values as $value) {
141
+            foreach ($values as $value)
142
+            {
135 143
                 header(sprintf(
136 144
                     '%s: %s',
137 145
                     $name,
Please login to merge, or discard this patch.