diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e3a5d2375..5b870e48c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -24,28 +24,28 @@ jobs: cs: uses: bedita/github-workflows/.github/workflows/php-cs.yml@v2 with: - php_versions: '["8.5"]' + php_versions: '["8.6"]' psalm: uses: bedita/github-workflows/.github/workflows/php-psalm.yml@v2 with: - php_versions: '["8.5"]' + php_versions: '["8.6"]' stan: uses: bedita/github-workflows/.github/workflows/php-stan.yml@v2 with: - php_versions: '["8.5"]' + php_versions: '["8.6"]' unit-5: uses: bedita/github-workflows/.github/workflows/php-unit.yml@v2 with: - php_versions: '["8.3","8.4"]' + php_versions: '["8.4","8.5"]' bedita_version: '5' coverage_min_percentage: 98 unit-6: uses: bedita/github-workflows/.github/workflows/php-unit.yml@v2 with: - php_versions: '["8.4","8.5"]' + php_versions: '["8.5","8.6"]' bedita_version: '6' coverage_min_percentage: 98 diff --git a/composer.json b/composer.json index 1be557369..ca2514912 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "phpstan/phpstan": "^2.1", "phpstan/phpstan-deprecation-rules": "^2", "phpunit/phpunit": "^11.1.3", - "vimeo/psalm": "^6.8" + "vimeo/psalm": "^7" }, "autoload": { "psr-4": { diff --git a/config/bootstrap.php b/config/bootstrap.php index 87a07e5e3..b23313cfc 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -99,7 +99,9 @@ Configure::load('version', 'ini'); Configure::load('bedita-api-version', 'ini'); } catch (Exception $e) { - exit($e->getMessage() . "\n"); + ini_set('display_errors', '0'); + error_log($e->getMessage()); + exit; } /* diff --git a/psalm.xml b/psalm.xml index 70eaed158..2fad62662 100644 --- a/psalm.xml +++ b/psalm.xml @@ -3,7 +3,7 @@ errorLevel="7" findUnusedBaselineEntry="true" findUnusedCode="false" - phpVersion="8.5" + phpVersion="8.6" resolveFromConfigFile="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" diff --git a/src/View/Helper/LinkHelper.php b/src/View/Helper/LinkHelper.php index 4a09e4c56..bcf6fed2f 100644 --- a/src/View/Helper/LinkHelper.php +++ b/src/View/Helper/LinkHelper.php @@ -184,7 +184,7 @@ public function sortClass(string $field): string */ public function page(int $page): void { - echo $this->replaceQueryParams(['page' => $page]); + echo htmlspecialchars($this->replaceQueryParams(['page' => $page]), ENT_QUOTES, 'UTF-8'); } /** @@ -195,7 +195,7 @@ public function page(int $page): void */ public function pageSize(int $pageSize): void { - echo $this->replaceQueryParams(['page_size' => $pageSize]); + echo htmlspecialchars($this->replaceQueryParams(['page_size' => $pageSize]), ENT_QUOTES, 'UTF-8'); } /** diff --git a/tests/TestCase/Controller/DownloadControllerTest.php b/tests/TestCase/Controller/DownloadControllerTest.php index 78500afc8..ce88abc2a 100644 --- a/tests/TestCase/Controller/DownloadControllerTest.php +++ b/tests/TestCase/Controller/DownloadControllerTest.php @@ -32,6 +32,7 @@ class DownloadControllerTest extends TestCase */ public function setUp(): void { + parent::setUp(); $this->apiClient = ApiClientProvider::getApiClient(); } @@ -41,6 +42,7 @@ public function setUp(): void public function tearDown(): void { ApiClientProvider::setApiClient($this->apiClient); + parent::tearDown(); } /** diff --git a/tests/TestCase/Controller/ImportControllerTest.php b/tests/TestCase/Controller/ImportControllerTest.php index c45f6846f..8351098fc 100644 --- a/tests/TestCase/Controller/ImportControllerTest.php +++ b/tests/TestCase/Controller/ImportControllerTest.php @@ -86,6 +86,7 @@ public function setUp(): void public function tearDown(): void { ApiClientProvider::setApiClient($this->apiClient); + parent::tearDown(); } /** diff --git a/tests/TestCase/Controller/Model/ExportControllerTest.php b/tests/TestCase/Controller/Model/ExportControllerTest.php index 3cf068fc5..faa8384d7 100644 --- a/tests/TestCase/Controller/Model/ExportControllerTest.php +++ b/tests/TestCase/Controller/Model/ExportControllerTest.php @@ -48,6 +48,7 @@ class ExportControllerTest extends TestCase */ public function setUp(): void { + parent::setUp(); $this->apiClient = ApiClientProvider::getApiClient(); } @@ -57,6 +58,7 @@ public function setUp(): void public function tearDown(): void { ApiClientProvider::setApiClient($this->apiClient); + parent::tearDown(); } /** diff --git a/tests/TestCase/Controller/Model/ObjectTypesControllerTest.php b/tests/TestCase/Controller/Model/ObjectTypesControllerTest.php index 1d44f1440..cd71ccd82 100644 --- a/tests/TestCase/Controller/Model/ObjectTypesControllerTest.php +++ b/tests/TestCase/Controller/Model/ObjectTypesControllerTest.php @@ -106,6 +106,7 @@ public function setUp(): void public function tearDown(): void { ApiClientProvider::setApiClient($this->apiClient); + parent::tearDown(); } /** diff --git a/tests/TestCase/Controller/Model/SchemaControllerTest.php b/tests/TestCase/Controller/Model/SchemaControllerTest.php index 0cffc58ac..be58c5fce 100644 --- a/tests/TestCase/Controller/Model/SchemaControllerTest.php +++ b/tests/TestCase/Controller/Model/SchemaControllerTest.php @@ -81,6 +81,7 @@ public function setUp(): void public function tearDown(): void { ApiClientProvider::setApiClient($this->apiClient); + parent::tearDown(); } /** diff --git a/tests/TestCase/Controller/ModulesControllerTest.php b/tests/TestCase/Controller/ModulesControllerTest.php index 9b636a37a..084436998 100644 --- a/tests/TestCase/Controller/ModulesControllerTest.php +++ b/tests/TestCase/Controller/ModulesControllerTest.php @@ -79,6 +79,7 @@ public function setUp(): void public function tearDown(): void { Cache::disable(); + parent::tearDown(); } /** diff --git a/tests/TestCase/View/Helper/PropertyHelperTest.php b/tests/TestCase/View/Helper/PropertyHelperTest.php index 8441e2bbf..834f79d05 100644 --- a/tests/TestCase/View/Helper/PropertyHelperTest.php +++ b/tests/TestCase/View/Helper/PropertyHelperTest.php @@ -43,6 +43,7 @@ class PropertyHelperTest extends TestCase */ public function setUp(): void { + parent::setUp(); // set custom control handlers $propsConf = (array)Configure::read('Properties'); $propsConf['dummies'] = [