@@ -90,7 +90,7 @@ public function ready(): array
9090 while (!empty ($ record = $ this ->readRecord ())) {
9191 $ statusCode = $ this ->processRecord ($ record );
9292
93- if (null != $ statusCode ) {
93+ if (null !== $ statusCode ) {
9494 $ statusCodes [] = $ statusCode ;
9595 }
9696 }
@@ -180,11 +180,11 @@ private function readRecord(): array
180180 *
181181 * @param array $record The record that has been read
182182 *
183- * @return int Number of dispatched requests
183+ * @return null| int Number of dispatched requests
184184 *
185185 * @throws ProtocolException If the client sends an unexpected record.
186186 */
187- private function processRecord (array $ record ): int
187+ private function processRecord (array $ record ): ? int
188188 {
189189 $ requestId = $ record ['requestId ' ];
190190
@@ -195,7 +195,7 @@ private function processRecord(array $record): int
195195 } elseif (!isset ($ this ->requests [$ requestId ])) {
196196 throw new ProtocolException ('Invalid request id for record of type: ' .$ record ['type ' ]);
197197 } elseif (DaemonInterface::FCGI_PARAMS === $ record ['type ' ]) {
198- while (strlen ($ content ) > 0 ) {
198+ while (null !== $ content && strlen ($ content ) > 0 ) {
199199 $ this ->readNameValuePair ($ requestId , $ content );
200200 }
201201 } elseif (DaemonInterface::FCGI_STDIN === $ record ['type ' ]) {
@@ -218,11 +218,11 @@ private function processRecord(array $record): int
218218 * Process a FCGI_BEGIN_REQUEST record.
219219 *
220220 * @param int $requestId The request id sending the record
221- * @param string $contentData The content of the record
221+ * @param null| string $contentData The content of the record
222222 *
223223 * @throws ProtocolException If the FCGI_BEGIN_REQUEST record is unexpected
224224 */
225- private function processBeginRequestRecord (int $ requestId , string $ contentData ): void
225+ private function processBeginRequestRecord (int $ requestId , ? string $ contentData ): void
226226 {
227227 if (isset ($ this ->requests [$ requestId ])) {
228228 throw new ProtocolException ('Unexpected FCGI_BEGIN_REQUEST record ' );
@@ -257,9 +257,9 @@ private function processBeginRequestRecord(int $requestId, string $contentData):
257257 * Read a FastCGI name-value pair from a buffer and add it to the request params.
258258 *
259259 * @param int $requestId The request id that sent the name-value pair
260- * @param string $buffer The buffer to read the pair from (pass by reference)
260+ * @param null| string $buffer The buffer to read the pair from (pass by reference)
261261 */
262- private function readNameValuePair (int $ requestId , string &$ buffer ): void
262+ private function readNameValuePair (int $ requestId , ? string &$ buffer ): void
263263 {
264264 $ nameLength = $ this ->readFieldLength ($ buffer );
265265 $ valueLength = $ this ->readFieldLength ($ buffer );
0 commit comments