Skip to content

Commit 856abd6

Browse files
committed
Removed implicitly nullable arguments
1 parent 1bdd386 commit 856abd6

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/AppHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class AppHandler implements RequestHandlerInterface
3535
/**
3636
* @param Build|null $build
3737
*/
38-
public function __construct(Build $build = null)
38+
public function __construct(?Build $build = null)
3939
{
4040
$this->registerShutdown((bool) getenv(static::DEV_ENVIRONMENT));
4141
$this->setup = $this->environmentSetup($build ?? new Build());
@@ -56,7 +56,7 @@ final public function handle(ServerRequestInterface $request): ResponseInterface
5656
/**
5757
* @param string $id
5858
*
59-
* @return Setup\Entry
59+
* @return Entry
6060
*/
6161
final public function config(string $id): Entry
6262
{

tests/Doubles/FakeServerRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FakeServerRequest implements ServerRequestInterface
2424
public array $cookies = [];
2525
public array $parsed = [];
2626

27-
public function __construct(string $method = 'GET', UriInterface $uri = null)
27+
public function __construct(string $method = 'GET', ?UriInterface $uri = null)
2828
{
2929
$this->method = $method;
3030
$this->uri = $uri ?? FakeUri::fromString('//example.com/foo/bar');

tests/Fixtures/HeadersState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function set(string $headerLine, $remove = true): void
3434
self::$headers[strtolower($name)][] = $headerLine;
3535
}
3636

37-
public static function remove(string $name = null): void
37+
public static function remove(?string $name = null): void
3838
{
3939
if ($name === null) {
4040
self::$headers = [];

tests/Fixtures/shutdown-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function register_shutdown_function(callable $callback): void
1818
ShutdownState::$override ? ShutdownState::$callback = $callback : \register_shutdown_function($callback);
1919
}
2020

21-
function http_response_code(int $code = null): void
21+
function http_response_code(?int $code = null): void
2222
{
2323
ShutdownState::$override ? ShutdownState::$status = $code : \http_response_code($code);
2424
}

tests/ServerProcessTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testHeadersSetOutsideServerInstanceAreIgnored()
9191
$this->assertFalse(isset(Fixtures\HeadersState::$headers['x-powered-by']));
9292
}
9393

94-
private function server(Doubles\FakeResponse $response = null, int $buffer = 0): ServerProcess
94+
private function server(?Doubles\FakeResponse $response = null, int $buffer = 0): ServerProcess
9595
{
9696
Fixtures\HeadersState::reset();
9797
$requestHandler = new Doubles\FakeRequestHandler(function () use ($response) {
@@ -100,11 +100,11 @@ private function server(Doubles\FakeResponse $response = null, int $buffer = 0):
100100
return new ServerProcess($requestHandler, $buffer);
101101
}
102102

103-
private function emit(ServerProcess $server, Doubles\FakeServerRequest $request = null): string
103+
private function emit(ServerProcess $server): string
104104
{
105105
ob_start();
106106
try {
107-
$server->execute($request ?: new Doubles\FakeServerRequest());
107+
$server->execute(new Doubles\FakeServerRequest());
108108
} catch (RuntimeException $ex) {
109109
ob_get_clean();
110110
throw $ex;

0 commit comments

Comments
 (0)