Skip to content

Commit

Permalink
Formatted method argument spacing
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <tom@inflatablecookie.com>
  • Loading branch information
betterthanclay committed Nov 3, 2023
1 parent 2b035f2 commit 550f851
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
15 changes: 9 additions & 6 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ public function getMethod(): string
/**
* Check method
*/
public static function isValidMethod(?string $method): bool
{
public static function isValidMethod(
?string $method
): bool {
return in_array($method, static::METHODS);
}

Expand Down Expand Up @@ -340,8 +341,9 @@ public function getCookieParam(
/**
* Is $cookie set?
*/
public function hasCookieParam(string $key): bool
{
public function hasCookieParam(
string $key
): bool {
return isset($this->cookies[$key]);
}

Expand Down Expand Up @@ -474,8 +476,9 @@ public function getServerParam(
/**
* Is $key in $server?
*/
public function hasServerParam(string $key): bool
{
public function hasServerParam(
string $key
): bool {
return isset($this->server[$key]);
}

Expand Down
5 changes: 3 additions & 2 deletions src/Request/Factory/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,9 @@ public function extractProtocol(
*
* @return array<string, string>
*/
public function parseCookies(string $string): array
{
public function parseCookies(
string $string
): array {
preg_match_all('(
(?:^\\n?[ \t]*|;[ ])
(?P<name>[!#$%&\'*+-.0-9A-Z^_`a-z|~]+)
Expand Down
10 changes: 8 additions & 2 deletions src/Stage.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@

interface Stage extends Handler
{
public function setPriority(?int $priority): Stage;
public function setPriority(
?int $priority
): Stage;

public function getPriority(): int;
public function getDefaultPriority(): int;

public function getMiddleware(): Middleware;
public function run(Request $handler): Response;

public function run(
Request $handler
): Response;
}
10 changes: 6 additions & 4 deletions src/StageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public function getDefaultPriority(): int
/**
* Fiber interchange
*/
public function handle(Request $request): Response
{
public function handle(
Request $request
): Response {
$response = Fiber::suspend($request);

if (!$response instanceof Response) {
Expand All @@ -73,8 +74,9 @@ public function handle(Request $request): Response
/**
* Process middleware
*/
public function run(Request $request): Response
{
public function run(
Request $request
): Response {
return $this->getMiddleware()->process($request, $this);
}
}

0 comments on commit 550f851

Please sign in to comment.