diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 91809c3..984ca21 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -101,7 +101,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, intl, sqlite, bcmath coverage: none @@ -127,9 +127,19 @@ jobs: fi - name: Run phpstan - run: vendor/bin/phpstan analyse --error-format=github + run: vendor/bin/phpstan analyse src tests --error-format=github > phpstan.errors - name: Run phpcs - run: composer cs-check + run: composer cs-check > phpcs.errors + + - uses: https://github.com/christopherHX/gitea-upload-artifact@v4 + with: + name: phpstan + path: phpstan.errors + + - uses: https://github.com/christopherHX/gitea-upload-artifact@v4 + with: + name: phpcs + path: phpcs.errors diff --git a/composer.json b/composer.json index f03a0aa..13a3f0a 100644 --- a/composer.json +++ b/composer.json @@ -4,15 +4,16 @@ "type": "cakephp-plugin", "license": "MIT", "require": { - "php": ">=8.1", - "cakephp/cakephp": "^5.0.1", + "php": ">=8.2", + "cakephp/cakephp": "^5.1", "ext-bcmath": "*" }, "require-dev": { - "phpunit/phpunit": "^10.1", + "phpunit/phpunit": "^10.3", "php-collective/decimal-object": "^1.3", "cakephp/migrations": "^4.0.0", - "phpstan/phpstan": "^2.1" + "phpstan/phpstan": "^2.1", + "dereuromark/composer-prefer-lowest": "^0.1.10" }, "suggest": { "dereuromark/cakephp-geo": "^3.2" diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..fb2534f --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +includes: + - vendor/cakedc/cakephp-phpstan/extension.neon +parameters: + level: 5 + paths: + - src + treatPhpDocTypesAsCertain: false + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..4e9226b --- /dev/null +++ b/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 31b3827..38ebb8e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,7 +9,6 @@ use Cake\Database\Connection; use Cake\Datasource\ConnectionManager; use Cake\TestSuite\Fixture\SchemaLoader; use CakeAddresses\CakeAddressesPlugin; -use CakeProducts\CakeProductsPlugin; use Migrations\TestSuite\Migrator; use TestApp\Controller\AppController;