From 2fece725a465fa5cde86b3e1c99d00e2b5e0e010 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 9 May 2025 13:23:04 +0200 Subject: [PATCH 1/3] Improve cypress workflow: add php 8.4 + ignore upload warnings --- .github/workflows/cypress.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 57131547..e93257f1 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: [ '8.1', '8.2', '8.3' ] + php-versions: [ '8.1', '8.2', '8.3', '8.4' ] ots: ['tfs-1.4', 'canary-3.1.2'] # TODO: add 'tfs-master' (actually doesn't work cause AAC doesn't support reading .env configuration) name: Cypress (PHP ${{ matrix.php-versions }}, ${{ matrix.ots }}) steps: @@ -146,6 +146,7 @@ jobs: with: name: cypress-screenshots-${{ matrix.php-versions }}-${{ matrix.ots }} path: cypress/screenshots + if-no-files-found: ignore - name: Upload Cypress Videos uses: actions/upload-artifact@v4 @@ -153,6 +154,7 @@ jobs: with: name: cypress-videos-${{ matrix.php-versions }}-${{ matrix.ots }} path: cypress/videos + if-no-files-found: ignore - name: Upload PHP Logs uses: actions/upload-artifact@v4 From 03e275213901a89edb0ebb8974b776a992ab391f Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 9 May 2025 13:38:48 +0200 Subject: [PATCH 2/3] Use optionally separate folder for views (thanks @Scrollog for idea) --- system/template.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/template.php b/system/template.php index 08ff2e7d..f051e640 100644 --- a/system/template.php +++ b/system/template.php @@ -136,6 +136,11 @@ if($forumSetting != '') $twig->addGlobal('template_name', $template_name); $twig->addGlobal('template_path', $template_path); if($twig_loader) { + $viewsPath = BASE . $template_path . '/views'; + if (is_dir($viewsPath)) { + $twig_loader->prependPath($viewsPath); + } + $twig_loader->prependPath(BASE . $template_path); } From 4ca58b4178ce7cb69e2052e6ddcf5f68f251472f Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 9 May 2025 13:45:46 +0200 Subject: [PATCH 3/3] Fix PHP 8.4 deprecation warnings "Implicitly marking parameter $var as nullable is deprecated, the explicit nullable type must be used instead" --- system/libs/pot/OTS_Guild.php | 4 ++-- system/libs/pot/OTS_GuildRank.php | 2 +- system/libs/pot/OTS_Player.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system/libs/pot/OTS_Guild.php b/system/libs/pot/OTS_Guild.php index bab363a8..a7b56728 100644 --- a/system/libs/pot/OTS_Guild.php +++ b/system/libs/pot/OTS_Guild.php @@ -97,7 +97,7 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable * * @param IOTS_GuildAction $invites Invites driver (don't pass it to clear driver). */ - public function setInvitesDriver(IOTS_GuildAction $invites = null) + public function setInvitesDriver(?IOTS_GuildAction $invites = null) { $this->invites = $invites; } @@ -107,7 +107,7 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable * * @param IOTS_GuildAction $requests Membership requests driver (don't pass it to clear driver). */ - public function setRequestsDriver(IOTS_GuildAction $requests = null) + public function setRequestsDriver(?IOTS_GuildAction $requests = null) { $this->requests = $requests; } diff --git a/system/libs/pot/OTS_GuildRank.php b/system/libs/pot/OTS_GuildRank.php index a8832faa..5e8ffb92 100644 --- a/system/libs/pot/OTS_GuildRank.php +++ b/system/libs/pot/OTS_GuildRank.php @@ -60,7 +60,7 @@ class OTS_GuildRank extends OTS_Row_DAO implements IteratorAggregate, Countable * @throws PDOException On PDO operation error. * @throws E_OTS_NotLoaded If given $guild object is not loaded. */ - public function find($name, OTS_Guild $guild = null) + public function find($name, ?OTS_Guild $guild = null) { $where = ''; diff --git a/system/libs/pot/OTS_Player.php b/system/libs/pot/OTS_Player.php index 5c1cbf87..7b688d1c 100644 --- a/system/libs/pot/OTS_Player.php +++ b/system/libs/pot/OTS_Player.php @@ -2026,7 +2026,7 @@ class OTS_Player extends OTS_Row_DAO * @param OTS_GuildRank|null Guild rank (null to clear assign). * @throws E_OTS_NotLoaded If passed $guildRank parameter is not loaded. */ - public function setRank(OTS_GuildRank $guildRank = null) + public function setRank(?OTS_GuildRank $guildRank = null) { if(isset($guildRank)) $this->setRankId($guildRank->getId(), $guildRank->getGuild()->getId()); @@ -2632,7 +2632,7 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function setSlot($slot, OTS_Item $item = null, $pid = 0) + public function setSlot($slot, ?OTS_Item $item = null, $pid = 0) { static $sid; @@ -2776,7 +2776,7 @@ class OTS_Player extends OTS_Row_DAO * @throws E_OTS_NotLoaded If player is not loaded. * @throws PDOException On PDO operation error. */ - public function setDepot($depot, OTS_Item $item = null, $pid = 0, $depot_id = 0) + public function setDepot($depot, ?OTS_Item $item = null, $pid = 0, $depot_id = 0) { static $sid;