Skip to content

Commit

Permalink
Implicitly nullable parameter types are deprecated in PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spaze committed Nov 23, 2024
1 parent 5217ac9 commit aa81698
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/Templating/TemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(


#[Override]
public function createTemplate(Control $control = null, string $class = null): DefaultTemplate
public function createTemplate(?Control $control = null, ?string $class = null): DefaultTemplate
{
$template = $this->templateFactory->createTemplate($control, $class);
if (!$template instanceof DefaultTemplate) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/Test/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public function setUrl(UrlScript $url): void


#[Override]
public function getQuery(string $key = null)
public function getQuery(?string $key = null)
{
return $key === null ? $this->url->getQueryParameters() : $this->url->getQueryParameter($key);
}


#[Override]
public function getPost(string $key = null)
public function getPost(?string $key = null)
{
return func_num_args() === 0 ? $this->post : $this->post[$key] ?? null;
}
Expand Down
14 changes: 7 additions & 7 deletions app/src/Test/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function addHeader(string $name, string $value): self


#[Override]
public function setContentType(string $type, string $charset = null): self
public function setContentType(string $type, ?string $charset = null): self
{
$this->contentType = $type;
$this->contentCharset = $charset;
Expand Down Expand Up @@ -147,11 +147,11 @@ public function setCookie(
string $name,
string $value,
string|int|DateTimeInterface|null $expire,
string $path = null,
string $domain = null,
bool $secure = null,
bool $httpOnly = null,
string $sameSite = null,
?string $path = null,
?string $domain = null,
?bool $secure = null,
?bool $httpOnly = null,
?string $sameSite = null,
): self {
$this->cookies[$name][] = new Cookie(
$name,
Expand All @@ -166,7 +166,7 @@ public function setCookie(


#[Override]
public function deleteCookie(string $name, string $path = null, string $domain = null, bool $secure = null): void
public function deleteCookie(string $name, ?string $path = null, ?string $domain = null, ?bool $secure = null): void
{
unset($this->cookies[$name]);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/Www/Presenters/BasePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected function getLocaleLinkParams(): array


#[Override]
public function lastModified(string|int|DateTimeInterface|null $lastModified, string $etag = null, string $expire = null): void
public function lastModified(string|int|DateTimeInterface|null $lastModified, ?string $etag = null, ?string $expire = null): void
{
$compression = ini_get('zlib.output_compression');
ini_set('zlib.output_compression', false);
Expand Down

0 comments on commit aa81698

Please sign in to comment.