diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e283896..7b69991 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,15 +9,15 @@ on: jobs: testsuite: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - php-version: ['8.1'] + php-version: ['8.2', '8.3', '8.4'] db-type: ['sqlite', 'mysql', 'pgsql'] prefer-lowest: [''] include: - - php-version: '8.1' + - php-version: '8.2' db-type: 'sqlite' prefer-lowest: 'prefer-lowest' @@ -90,12 +90,12 @@ jobs: run: if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/validate-prefer-lowest -m; fi - name: Code Coverage Report - if: success() && matrix.php-version == '8.1' && matrix.db-type == 'sqlite' + if: success() && matrix.php-version == '8.2' && matrix.db-type == 'sqlite' uses: codecov/codecov-action@v1 validation: name: Coding Standard & Static Analysis - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 @@ -103,7 +103,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.4' extensions: mbstring, intl coverage: none diff --git a/composer.json b/composer.json index 7b61171..2c19a6e 100644 --- a/composer.json +++ b/composer.json @@ -5,12 +5,12 @@ "license": "MIT", "require": { "php": ">=8.1", - "cakephp/cakephp": "^5.0" + "cakephp/cakephp": "5.3.0-RC2" }, "require-dev": { - "cakedc/cakephp-phpstan": "^3.0", + "cakedc/cakephp-phpstan": "^4.0", "cakephp/cakephp-codesniffer": "^5.0.0", - "phpunit/phpunit": "^10.1.0" + "phpunit/phpunit": "^10.1.0 || ^11 || ^12" }, "autoload": { "psr-4": { @@ -33,10 +33,10 @@ }, "scripts": { "test": "phpunit", - "cs-check": "phpcs --colors --parallel=16 -p src/", - "cs-fix": "phpcbf --colors --parallel=16 -p src/", + "cs-check": "phpcs --colors --parallel=16 -p", + "cs-fix": "phpcbf --colors --parallel=16 -p", "stan": "phpstan analyse", - "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.7.0 && mv composer.backup composer.json", + "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^2.1.0 && mv composer.backup composer.json", "lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json" }, "prefer-stable": true diff --git a/phpcs.xml b/phpcs.xml index e42fcc5..2762fc8 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,8 +1,9 @@ - - - + + src/ + + diff --git a/phpstan.neon b/phpstan.neon index 95d75a6..e7dbd10 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,11 +1,12 @@ parameters: level: 6 - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false - paths: - - src bootstrapFiles: - tests/bootstrap.php + paths: + - src + ignoreErrors: + - identifier: missingType.generics + - identifier: missingType.iterableValue includes: - vendor/cakedc/cakephp-phpstan/extension.neon diff --git a/src/Plugin.php b/src/Plugin.php index 7aa25ba..885531e 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -3,24 +3,9 @@ namespace ViteHelper; -use Cake\Core\BasePlugin; -use Cake\Core\Configure; -use Cake\Core\PluginApplicationInterface; - /** - * Plugin for ViteHelper + * @deprecated 2.5.0 Use ViteHelperPlugin instead */ -class Plugin extends BasePlugin +class Plugin extends ViteHelperPlugin { - /** - * @inheritDoc - */ - public function bootstrap(PluginApplicationInterface $app): void - { - parent::bootstrap($app); - - if (file_exists(ROOT . DS . 'config' . DS . 'app_vite.php')) { - Configure::load('app_vite'); - } - } } diff --git a/src/Utilities/ViteManifest.php b/src/Utilities/ViteManifest.php index c9f08a9..6686330 100644 --- a/src/Utilities/ViteManifest.php +++ b/src/Utilities/ViteManifest.php @@ -45,7 +45,7 @@ public static function getRecords(ViteHelperConfig $config): ManifestRecords "\u0000", ], '', - $json + $json, ); $manifest = json_decode($json, false, 512, JSON_THROW_ON_ERROR); diff --git a/src/View/Helper/ViteScriptsHelper.php b/src/View/Helper/ViteScriptsHelper.php index aa91420..bf3fc0e 100644 --- a/src/View/Helper/ViteScriptsHelper.php +++ b/src/View/Helper/ViteScriptsHelper.php @@ -130,7 +130,7 @@ private function devScript(array $options, ViteHelperConfig $config): void [ 'type' => 'module', 'block' => $options['cssBlock'], - ] + ], ); $files = $this->getFilesForDevelopment($options, $config, 'scriptEntries'); @@ -289,7 +289,7 @@ private function getFilesForDevelopment(array $options, ViteHelperConfig $config if (empty($files)) { throw new ConfigurationException( 'There are no valid entry points for the dev server. ' - . 'Be sure to set the ViteHelper.development.' . $configOption . ' config or pass entries to the helper.' + . 'Be sure to set the ViteHelper.development.' . $configOption . ' config or pass entries to the helper.', ); } diff --git a/src/ViteHelperPlugin.php b/src/ViteHelperPlugin.php new file mode 100644 index 0000000..5144761 --- /dev/null +++ b/src/ViteHelperPlugin.php @@ -0,0 +1,26 @@ +