Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start testing on PHP 8.4 except Psalm #437

Merged
merged 3 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/php-tester-include-skipped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- name: OS info
run: cat /etc/os-release
Expand All @@ -33,6 +34,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Validate composer.json and composer.lock
Expand All @@ -50,6 +52,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand All @@ -70,6 +73,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand All @@ -84,6 +88,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand All @@ -98,6 +103,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand All @@ -118,6 +124,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get PHP_CodeSniffer cache file pattern
Expand All @@ -139,6 +146,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get PHPStan result cache directory
Expand All @@ -160,6 +168,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get PHPStan result cache directory
Expand All @@ -181,6 +190,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand Down Expand Up @@ -223,6 +233,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/securitytxt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
host:
- www.michalspacek.cz
- www.michalspacek.com
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
matrix:
php-version:
- "8.3"
- "8.4"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2
Expand Down
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
4 changes: 2 additions & 2 deletions app/tests/Training/Files/TrainingFilesDownloadTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class TrainingFilesDownloadTest extends TestCase
$sessionSection = $this->session->getSection('training');
$sessionSection->set('applicationId', self::APPLICATION_ID);
$sessionSection->set('token', self::TOKEN);
$filename = basename(__FILE__);
$filename = 'file.zip';
$filesDir = __DIR__ . '/';
$this->database->setFetchResult([
'added' => new DateTime(),
Expand All @@ -125,7 +125,7 @@ class TrainingFilesDownloadTest extends TestCase
$response = $this->trainingFilesDownload->getFileResponse('foo');
Assert::same($filesDir . $filename, $response->getFile());
Assert::same($filename, $response->getName());
Assert::same('text/x-php', $response->getContentType());
Assert::same('application/zip', $response->getContentType());
}


Expand Down
Binary file added app/tests/Training/Files/file.zip
Binary file not shown.