diff --git a/.github/workflows/php-tester-include-skipped.yml b/.github/workflows/php-tester-include-skipped.yml index c6d72e642..ed9dcfd55 100644 --- a/.github/workflows/php-tester-include-skipped.yml +++ b/.github/workflows/php-tester-include-skipped.yml @@ -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 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 534b1dd0d..1a6b41964 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,6 +15,7 @@ jobs: matrix: php-version: - "8.3" + - "8.4" steps: - name: OS info run: cat /etc/os-release @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/securitytxt.yml b/.github/workflows/securitytxt.yml index 7345687e5..d97fc9e09 100644 --- a/.github/workflows/securitytxt.yml +++ b/.github/workflows/securitytxt.yml @@ -16,6 +16,7 @@ jobs: matrix: php-version: - "8.3" + - "8.4" host: - www.michalspacek.cz - www.michalspacek.com diff --git a/.github/workflows/tls.yml b/.github/workflows/tls.yml index 1302d7a88..612984bfb 100644 --- a/.github/workflows/tls.yml +++ b/.github/workflows/tls.yml @@ -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 diff --git a/app/src/Templating/TemplateFactory.php b/app/src/Templating/TemplateFactory.php index 88cb683c1..1b291dc78 100644 --- a/app/src/Templating/TemplateFactory.php +++ b/app/src/Templating/TemplateFactory.php @@ -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) { diff --git a/app/src/Test/Http/Request.php b/app/src/Test/Http/Request.php index 221ec3b6b..866b97777 100644 --- a/app/src/Test/Http/Request.php +++ b/app/src/Test/Http/Request.php @@ -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; } diff --git a/app/src/Test/Http/Response.php b/app/src/Test/Http/Response.php index c16a7671a..536fa6266 100644 --- a/app/src/Test/Http/Response.php +++ b/app/src/Test/Http/Response.php @@ -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; @@ -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, @@ -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]); } diff --git a/app/src/Www/Presenters/BasePresenter.php b/app/src/Www/Presenters/BasePresenter.php index 5a97a13a0..4c670686c 100644 --- a/app/src/Www/Presenters/BasePresenter.php +++ b/app/src/Www/Presenters/BasePresenter.php @@ -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); diff --git a/app/tests/Training/Files/TrainingFilesDownloadTest.phpt b/app/tests/Training/Files/TrainingFilesDownloadTest.phpt index 9838417a8..c7a73da40 100644 --- a/app/tests/Training/Files/TrainingFilesDownloadTest.phpt +++ b/app/tests/Training/Files/TrainingFilesDownloadTest.phpt @@ -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(), @@ -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()); } diff --git a/app/tests/Training/Files/file.zip b/app/tests/Training/Files/file.zip new file mode 100644 index 000000000..15cb0ecb3 Binary files /dev/null and b/app/tests/Training/Files/file.zip differ