Skip to content

Commit 804be9e

Browse files
committed
Fix codeql
1 parent 13d59cb commit 804be9e

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public static function error(): Hook
344344
* @param string|null $default
345345
* @return string|null
346346
*/
347-
public static function getEnv(string $key, string $default = null): ?string
347+
public static function getEnv(string $key, ?string $default = null): ?string
348348
{
349349
return $_SERVER[$key] ?? $default;
350350
}

src/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function getRawPayload(): string
136136
* @param string|null $default
137137
* @return string|null
138138
*/
139-
public function getServer(string $key, string $default = null): ?string
139+
public function getServer(string $key, ?string $default = null): ?string
140140
{
141141
return $_SERVER[$key] ?? $default;
142142
}

src/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public function getHeaders(): array
533533
* @param bool $httponly
534534
* @param string $sameSite
535535
*/
536-
public function addCookie(string $name, string $value = null, int $expire = null, string $path = null, string $domain = null, bool $secure = null, bool $httponly = null, string $sameSite = null): static
536+
public function addCookie(string $name, ?string $value = null, ?int $expire = null, ?string $path = null, ?string $domain = null, ?bool $secure = null, ?bool $httponly = null, ?string $sameSite = null): static
537537
{
538538
$name = strtolower($name);
539539

@@ -665,7 +665,7 @@ protected function write(string $content): void
665665
* @param string $content
666666
* @return void
667667
*/
668-
protected function end(string $content = null): void
668+
protected function end(?string $content = null): void
669669
{
670670
if (!is_null($content)) {
671671
echo $content;

tests/AppTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public function providerRouteMatching(): array
467467
/**
468468
* @dataProvider providerRouteMatching
469469
*/
470-
public function testCanMatchRoute(string $method, string $path, string $url = null): void
470+
public function testCanMatchRoute(string $method, string $path, ?string $url = null): void
471471
{
472472
$url ??= $path;
473473
$expected = null;

0 commit comments

Comments
 (0)