Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Jun 24, 2024
1 parent 4897227 commit 0876134
Show file tree
Hide file tree
Showing 41 changed files with 100 additions and 41 deletions.
4 changes: 3 additions & 1 deletion src/ApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

class ApplicationFactory
{
public function __construct(protected string $basePath) {}
public function __construct(protected string $basePath)
{
}

/**
* Create a new application instance.
Expand Down
4 changes: 3 additions & 1 deletion src/ApplicationGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class ApplicationGateway
{
use DispatchesEvents;

public function __construct(protected Application $app, protected Application $sandbox) {}
public function __construct(protected Application $app, protected Application $sandbox)
{
}

/**
* Handle an incoming request.
Expand Down
4 changes: 3 additions & 1 deletion src/Cache/OctaneStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class OctaneStore implements Store
* @param \Swoole\Table $table
* @return void
*/
public function __construct(protected $table) {}
public function __construct(protected $table)
{
}

/**
* Retrieve an item from the cache by key.
Expand Down
3 changes: 2 additions & 1 deletion src/Events/RequestHandled.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ public function __construct(
public Application $sandbox,
public Request $request,
public Response $response
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Events/RequestReceived.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ public function __construct(
public Application $app,
public Application $sandbox,
public Request $request
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Events/RequestTerminated.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public function __construct(
public Application $sandbox,
public Request $request,
public Response $response
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Events/TaskReceived.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public function __construct(
public Application $app,
public Application $sandbox,
public $data
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Events/TaskTerminated.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public function __construct(
public Application $sandbox,
public $data,
public $result,
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Events/TickReceived.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ class TickReceived
public function __construct(
public Application $app,
public Application $sandbox
) {}
) {
}
}
3 changes: 2 additions & 1 deletion src/Events/TickTerminated.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ class TickTerminated implements OperationTerminated
public function __construct(
public Application $app,
public Application $sandbox
) {}
) {
}
}
4 changes: 3 additions & 1 deletion src/Events/WorkerErrorOccurred.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@

class WorkerErrorOccurred
{
public function __construct(public Throwable $exception, public Application $sandbox) {}
public function __construct(public Throwable $exception, public Application $sandbox)
{
}
}
4 changes: 3 additions & 1 deletion src/Events/WorkerStarting.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

class WorkerStarting
{
public function __construct(public Application $app) {}
public function __construct(public Application $app)
{
}
}
4 changes: 3 additions & 1 deletion src/Events/WorkerStopping.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

class WorkerStopping
{
public function __construct(public Application $app) {}
public function __construct(public Application $app)
{
}
}
4 changes: 3 additions & 1 deletion src/Exceptions/ServerShutdownException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

use Exception;

class ServerShutdownException extends Exception {}
class ServerShutdownException extends Exception
{
}
3 changes: 2 additions & 1 deletion src/Exceptions/TaskExceptionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public function __construct(
protected int $code,
protected string $file,
protected int $line,
) {}
) {
}

/**
* Creates a new task exception result from the given throwable.
Expand Down
3 changes: 2 additions & 1 deletion src/FrankenPhp/ServerProcessInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class ServerProcessInspector implements ServerProcessInspectorContract
*/
public function __construct(
protected ServerStateFile $serverStateFile,
) {}
) {
}

/**
* Determine if the FrankenPHP server process is running.
Expand Down
4 changes: 3 additions & 1 deletion src/FrankenPhp/ServerStateFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class ServerStateFile
{
public function __construct(protected string $path) {}
public function __construct(protected string $path)
{
}

/**
* Read the server state from the server state file.
Expand Down
4 changes: 3 additions & 1 deletion src/OctaneResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

class OctaneResponse
{
public function __construct(public Response $response, public ?string $outputBuffer = null) {}
public function __construct(public Response $response, public ?string $outputBuffer = null)
{
}
}
4 changes: 3 additions & 1 deletion src/RequestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class RequestContext implements ArrayAccess
{
public function __construct(public array $data = []) {}
public function __construct(public array $data = [])
{
}

#[\ReturnTypeWillChange]
public function offsetExists($offset)
Expand Down
4 changes: 3 additions & 1 deletion src/RoadRunner/RoadRunnerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class RoadRunnerClient implements Client, StoppableClient
{
use MarshalsPsr7RequestsAndResponses;

public function __construct(protected PSR7Worker $client) {}
public function __construct(protected PSR7Worker $client)
{
}

/**
* Marshal the given request context into an Illuminate request.
Expand Down
3 changes: 2 additions & 1 deletion src/RoadRunner/ServerProcessInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function __construct(
protected ServerStateFile $serverStateFile,
protected SymfonyProcessFactory $processFactory,
protected PosixExtension $posix
) {}
) {
}

/**
* Determine if the RoadRunner server process is running.
Expand Down
4 changes: 3 additions & 1 deletion src/RoadRunner/ServerStateFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class ServerStateFile
{
public function __construct(protected string $path) {}
public function __construct(protected string $path)
{
}

/**
* Read the server state from the server state file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public function __construct(
protected $timerTable,
protected $maxExecutionTime,
protected ?Server $server = null
) {}
) {
}

/**
* Invoke the action.
Expand Down
3 changes: 2 additions & 1 deletion src/Swoole/Handlers/OnManagerStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public function __construct(
protected SwooleExtension $extension,
protected string $appName,
protected bool $shouldSetProcessName = true
) {}
) {
}

/**
* Handle the "managerstart" Swoole event.
Expand Down
3 changes: 2 additions & 1 deletion src/Swoole/Handlers/OnServerStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function __construct(
protected $timerTable,
protected bool $shouldTick = true,
protected bool $shouldSetProcessName = true
) {}
) {
}

/**
* Handle the "start" Swoole event.
Expand Down
3 changes: 2 additions & 1 deletion src/Swoole/Handlers/OnWorkerStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function __construct(
protected array $serverState,
protected WorkerState $workerState,
protected bool $shouldSetProcessName = true
) {}
) {
}

/**
* Handle the "workerstart" Swoole event.
Expand Down
3 changes: 2 additions & 1 deletion src/Swoole/InvokeTickCallable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public function __construct(
protected bool $immediate,
protected $cache,
protected ExceptionHandler $exceptionHandler
) {}
) {
}

/**
* Invoke the tick listener.
Expand Down
3 changes: 2 additions & 1 deletion src/Swoole/ServerProcessInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public function __construct(
protected SignalDispatcher $dispatcher,
protected ServerStateFile $serverStateFile,
protected Exec $exec,
) {}
) {
}

/**
* Determine if the Swoole server process is running.
Expand Down
4 changes: 3 additions & 1 deletion src/Swoole/ServerStateFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

class ServerStateFile
{
public function __construct(protected string $path) {}
public function __construct(protected string $path)
{
}

/**
* Read the server state from the server state file.
Expand Down
4 changes: 3 additions & 1 deletion src/Swoole/SignalDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

class SignalDispatcher
{
public function __construct(protected SwooleExtension $extension) {}
public function __construct(protected SwooleExtension $extension)
{
}

/**
* Determine if the given process ID can be communicated with.
Expand Down
4 changes: 3 additions & 1 deletion src/Swoole/SwooleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class SwooleClient implements Client, ServesStaticFiles
451 => 'Unavailable For Legal Reasons', // RFC7725
];

public function __construct(protected int $chunkSize = 1048576) {}
public function __construct(protected int $chunkSize = 1048576)
{
}

/**
* Marshal the given request context into an Illuminate request.
Expand Down
4 changes: 3 additions & 1 deletion src/Swoole/SwooleCoroutineDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

class SwooleCoroutineDispatcher implements DispatchesCoroutines
{
public function __construct(protected bool $withinCoroutineContext) {}
public function __construct(protected bool $withinCoroutineContext)
{
}

/**
* Concurrently resolve the given callbacks via coroutines, returning the results.
Expand Down
3 changes: 2 additions & 1 deletion src/Swoole/SwooleHttpTaskDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public function __construct(
protected string $host,
protected string $port,
protected DispatchesTasks $fallbackDispatcher
) {}
) {
}

/**
* Concurrently resolve the given callbacks via background tasks, returning the results.
Expand Down
4 changes: 3 additions & 1 deletion src/Swoole/TaskResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

class TaskResult
{
public function __construct(public mixed $result) {}
public function __construct(public mixed $result)
{
}
}
4 changes: 3 additions & 1 deletion src/Testing/Fakes/FakeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class FakeClient implements Client

public $errors = [];

public function __construct(public array $requests) {}
public function __construct(public array $requests)
{
}

public function marshalRequest(RequestContext $context): array
{
Expand Down
3 changes: 2 additions & 1 deletion src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class Worker implements WorkerContract
public function __construct(
protected ApplicationFactory $appFactory,
protected Client $client
) {}
) {
}

/**
* Boot / initialize the Octane worker.
Expand Down
3 changes: 2 additions & 1 deletion tests/QueuedCookieFlushingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public function test_queued_cookies_from_previous_requests_are_flushed()
$app['cookie']->queue('color', 'blue');
});

$app['router']->middleware('web')->get('/second', function (Application $app) {});
$app['router']->middleware('web')->get('/second', function (Application $app) {
});

$worker->run();

Expand Down
3 changes: 2 additions & 1 deletion tests/SequentialCoroutineDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function test_coroutines_can_be_resolved()
], $dispatcher->resolve([
'first' => fn () => 1,
'second' => fn () => 2,
'third' => function () {},
'third' => function () {
},
]));
}
}
3 changes: 2 additions & 1 deletion tests/SequentialTaskDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public function test_tasks_can_be_resolved()
], $dispatcher->resolve([
'first' => fn () => 1,
'second' => fn () => 2,
'third' => function () {},
'third' => function () {
},
]));
}

Expand Down
3 changes: 2 additions & 1 deletion tests/SwooleHttpTaskDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public function test_tasks_can_be_resolved_via_http()
], $dispatcher->resolve([
'first' => fn () => 1,
'second' => fn () => 2,
'third' => function () {},
'third' => function () {
},
]));
}

Expand Down
Loading

0 comments on commit 0876134

Please sign in to comment.