Skip to content

Commit c959b2a

Browse files
Coding standards
1 parent d504545 commit c959b2a

18 files changed

+99
-96
lines changed

src/CallbackWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class CallbackWrapper implements KernelInterface
1717

1818
/**
1919
* Constructor.
20-
*
20+
*
2121
* @param callable $handler The handler callback to wrap
22-
*
22+
*
2323
* @throws \InvalidArgumentException When not given callable callback
2424
*/
2525
public function __construct($handler)

src/Command/DaemonRunCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DaemonRunCommand extends Command
2424

2525
/**
2626
* Constructor.
27-
*
27+
*
2828
* @param string $name The name of the daemon run command
2929
* @param string $description The description of the daemon run command
3030
* @param DaemonFactoryInterface $daemonFactory The factory to use to create the daemon

src/Connection/StreamSocketConnection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ public function __construct($socket)
3333

3434
/**
3535
* Creates a formatted exception from the last error that occurecd.
36-
*
36+
*
3737
* @param string $function The function that failed
38-
*
38+
*
3939
* @return ConnectionException
4040
*/
4141
protected function createExceptionFromLastError($function)
4242
{
4343
$this->close();
4444

45-
return new ConnectionException($function . ' failed');
45+
return new ConnectionException($function.' failed');
4646
}
4747

4848
/**

src/Connection/StreamSocketConnectionPool.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function operate(ConnectionHandlerFactoryInterface $connectionHandlerFact
7070

7171
if (false === stream_select($read, $write, $except, $timeoutLoopSeconds, $timeoutLoopMicroseconds)) {
7272
$lastError = error_get_last();
73-
73+
7474
if (null === $lastError) {
7575
$this->logger->emergency('stream_select failed');
7676
} else {
@@ -94,7 +94,7 @@ public function operate(ConnectionHandlerFactoryInterface $connectionHandlerFact
9494

9595
/**
9696
* Accept incoming connections from the stream socket.
97-
*
97+
*
9898
* @param ConnectionHandlerFactoryInterface $connectionHandlerFactory The factory used to create connection handlers
9999
*/
100100
protected function acceptConnection(ConnectionHandlerFactoryInterface $connectionHandlerFactory)

src/ConnectionHandler/ConnectionHandler.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function close()
108108

109109
/**
110110
* Read a record from the connection.
111-
*
111+
*
112112
* @return array|null The record that has been read
113113
*/
114114
protected function readRecord()
@@ -142,7 +142,7 @@ protected function readRecord()
142142

143143
/**
144144
* Write a record to the connection.
145-
*
145+
*
146146
* @param int $requestId The request id to write to
147147
* @param int $type The type of record
148148
* @param string $content The content of the record
@@ -162,7 +162,7 @@ protected function writeRecord($requestId, $type, $content = null)
162162

163163
/**
164164
* Write a response to the connection as FCGI_STDOUT records.
165-
*
165+
*
166166
* @param int $requestId The request id to write to
167167
* @param string $headerData The header data to write (including terminating CRLFCRLF)
168168
* @param StreamInterface $stream The stream to write
@@ -194,7 +194,7 @@ protected function writeResponse($requestId, $headerData, StreamInterface $strea
194194
/**
195195
* End the request by writing an FCGI_END_REQUEST record and then removing
196196
* the request from memory and closing the connection if necessary.
197-
*
197+
*
198198
* @param int $requestId The request id to end
199199
* @param int $appStatus The application status to declare
200200
* @param int $protocolStatus The protocol status to declare
@@ -220,9 +220,9 @@ protected function endRequest($requestId, $appStatus = 0, $protocolStatus = Daem
220220

221221
/**
222222
* Process a record.
223-
*
223+
*
224224
* @param array $record The record that has been read
225-
*
225+
*
226226
* @throws ProtocolException If the client sends an unexpected record.
227227
*/
228228
protected function processRecord(array $record)
@@ -249,16 +249,16 @@ protected function processRecord(array $record)
249249
break;
250250

251251
default:
252-
throw new ProtocolException('Unexpected packet of unkown type: ' . $record['type']);
252+
throw new ProtocolException('Unexpected packet of unkown type: '.$record['type']);
253253
}
254254
}
255255

256256
/**
257257
* Process a FCGI_BEGIN_REQUEST record.
258-
*
258+
*
259259
* @param int $requestId The request id sending the record
260260
* @param string $contentData The content of the record
261-
*
261+
*
262262
* @throws ProtocolException If the FCGI_BEGIN_REQUEST record is unexpected
263263
*/
264264
protected function processBeginRequestRecord($requestId, $contentData)
@@ -285,10 +285,10 @@ protected function processBeginRequestRecord($requestId, $contentData)
285285

286286
/**
287287
* Process a FCGI_PARAMS record.
288-
*
288+
*
289289
* @param int $requestId The request id sending the record
290290
* @param string $contentData The content of the record
291-
*
291+
*
292292
* @throws ProtocolException If the FCGI_PARAMS record is unexpected
293293
*/
294294
protected function processParamsRecord($requestId, $contentData)
@@ -336,10 +336,10 @@ protected function processParamsRecord($requestId, $contentData)
336336

337337
/**
338338
* Process a FCGI_STDIN record.
339-
*
339+
*
340340
* @param int $requestId The request id sending the record
341341
* @param string $contentData The content of the record
342-
*
342+
*
343343
* @throws ProtocolException If the FCGI_STDIN record is unexpected
344344
*/
345345
protected function processStdinRecord($requestId, $contentData)
@@ -359,9 +359,9 @@ protected function processStdinRecord($requestId, $contentData)
359359

360360
/**
361361
* Process a FCGI_ABORT_REQUEST record.
362-
*
362+
*
363363
* @param int $requestId The request id sending the record
364-
*
364+
*
365365
* @throws ProtocolException If the FCGI_ABORT_REQUEST record is unexpected
366366
*/
367367
protected function processAbortRequestRecord($requestId)
@@ -375,9 +375,9 @@ protected function processAbortRequestRecord($requestId)
375375

376376
/**
377377
* Dispatches a request to the kernel.
378-
*
378+
*
379379
* @param int $requestId The request id that is ready to dispatch
380-
*
380+
*
381381
* @throws DaemonException If there is an error dispatching the request
382382
*/
383383
protected function dispatchRequest($requestId)
@@ -401,7 +401,7 @@ protected function dispatchRequest($requestId)
401401

402402
/**
403403
* Sends the response to the client.
404-
*
404+
*
405405
* @param int $requestId The request id to respond to
406406
* @param ResponseInterface $response The PSR-7 HTTP response message
407407
*/
@@ -410,7 +410,7 @@ protected function sendResponse($requestId, ResponseInterface $response)
410410
$headerData = "Status: {$response->getStatusCode()} {$response->getReasonPhrase()}\r\n";
411411

412412
foreach ($response->getHeaders() as $name => $values) {
413-
$headerData .= $name . ': ' . implode(', ', $values) ."\r\n";
413+
$headerData .= $name.': '.implode(', ', $values)."\r\n";
414414
}
415415

416416
$headerData .= "\r\n";

src/Daemon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Daemon implements DaemonInterface, LoggerAwareInterface
2929

3030
/**
3131
* Constructor.
32-
*
32+
*
3333
* @param ConnectionPoolInterface $connectionPool The connection pool to accept connections from
3434
* @param ConnectionHandlerFactoryInterface $connectionHandlerFactory A factory class for producing connection handlers
3535
* @param LoggerInterface $logger A logger to use

src/DaemonFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ class DaemonFactory implements DaemonFactoryInterface
1212
{
1313
/**
1414
* {@inheritdoc}
15-
*
15+
*
1616
* @codeCoverageIgnore
1717
*/
1818
public function createDaemon($kernel)
1919
{
20-
$socket = fopen('php://fd/' . DaemonInterface::FCGI_LISTENSOCK_FILENO, 'r');
20+
$socket = fopen('php://fd/'.DaemonInterface::FCGI_LISTENSOCK_FILENO, 'r');
2121

2222
return $this->createDaemonFromStreamSocket($kernel, $socket);
2323
}
2424

2525
/**
2626
* {@inheritdoc}
27-
*
27+
*
2828
* @codeCoverageIgnore
2929
*/
3030
public function createTcpDaemon($kernel, $port, $host = 'localhost')
3131
{
32-
$socket = stream_socket_server('tcp://' . $host . ':' . $port);
32+
$socket = stream_socket_server('tcp://'.$host.':'.$port);
3333

3434
return $this->createDaemonFromStreamSocket($kernel, $socket);
3535
}

src/DaemonFactoryInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ interface DaemonFactoryInterface
1111
{
1212
/**
1313
* Create a FastCGI daemon listening on FCGI_LISTENSOCK_FILENO.
14-
*
14+
*
1515
* @param KernelInterface|callable $kernel The daemon's kernel
16-
*
16+
*
1717
* @return DaemonInterface The FastCGI daemon
1818
*/
1919
public function createDaemon($kernel);
@@ -25,18 +25,18 @@ public function createDaemon($kernel);
2525
* @param KernelInterface|callable $kernel The daemon's kernel
2626
* @param int $port The port to bind to
2727
* @param string $host The host to bind to
28-
*
28+
*
2929
* @return DaemonInterface The FastCGI daemon
3030
*/
3131
public function createTcpDaemon($kernel, $port, $host = 'localhost');
3232

3333
/**
3434
* Create a FastCGI daemon from a stream socket which is configured for
3535
* accepting connections.
36-
*
36+
*
3737
* @param KernelInterface|callable $kernel The daemon's kernel
3838
* @param resource $socket The socket to accept connections from
39-
*
39+
*
4040
* @return DaemonInterface The FastCGI daemon
4141
*/
4242
public function createDaemonFromStreamSocket($kernel, $socket);

src/DaemonInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ interface DaemonInterface
4141

4242
/**
4343
* Run the daemon.
44-
*
44+
*
4545
* This is a blocking method that does not return.
46-
*
46+
*
4747
* @throws \Exception On fatal error
4848
*/
4949
public function run();

src/KernelInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface KernelInterface
1515
* Handles a request and returns a response.
1616
*
1717
* @param ServerRequestInterface $request The PSR-7 HTTP server request message
18-
*
18+
*
1919
* @return ResponseInterface The PSR-7 HTTP server response message
2020
*/
2121
public function handleRequest(ServerRequestInterface $request);

0 commit comments

Comments
 (0)