diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36dd697..386161a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,11 +11,11 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2'] + php-version: ['8.2', '8.3'] name: PHP ${{ matrix.php-version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -35,12 +35,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' extensions: mbstring, intl coverage: none @@ -52,4 +52,4 @@ jobs: - name: Run phpstan if: success() || failure() - run: vendor/bin/phpstan analyse src/ tests/ + run: vendor/bin/phpstan analyse diff --git a/.gitignore b/.gitignore index 244d127..77c68a6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /composer.phar /phpunit.xml /.phpunit.result.cache +/.phpunit.cache /phpunit.phar /config/Migrations/schema-dump-default.lock /vendor/ diff --git a/README.md b/README.md index 5c146e6..ed35dd7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SvgIcon plugin for CakePHP 4.x +# SvgIcon plugin for CakePHP 5.x ![Build Status](https://github.com/loadsys/cakephp-svg-icon/actions/workflows/ci.yml/badge.svg?branch=main) @@ -14,6 +14,11 @@ The recommended way to install composer packages is: composer require loadsys/cakephp-svg-icon ``` +## Versions + +* Tags `1.x` are for CakePHP v4.x. +* Tags `2.x` are for CakePHP v5.x. + ## Configuration Icons should be added to `config/app_svg_icon.php` - see the example included in `config` directory for the expected format. Any SVG icon should work, such as [heroicons](https://heroicons.com) or [Bootstrap Icons](https://icons.getbootstrap.com). diff --git a/composer.json b/composer.json index c5a7e04..e175de5 100644 --- a/composer.json +++ b/composer.json @@ -4,13 +4,13 @@ "type": "cakephp-plugin", "license": "MIT", "require": { - "php": ">=7.4", - "cakephp/cakephp": "4.*" + "php": ">=8.2", + "cakephp/cakephp": "^5.0" }, "require-dev": { - "cakephp/cakephp-codesniffer": "^4.5", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.3" + "cakephp/cakephp-codesniffer": "^5.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 46f96c0..9f7525e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,25 @@ - - - - src/ - - - - - - - - - - tests/TestCase/ - - - - - - + + + + + + + + + + tests/TestCase/ + + + + + + + diff --git a/src/View/Helper/SvgIconHelper.php b/src/View/Helper/SvgIconHelper.php index 026202e..9ced4f2 100644 --- a/src/View/Helper/SvgIconHelper.php +++ b/src/View/Helper/SvgIconHelper.php @@ -19,7 +19,7 @@ class SvgIconHelper extends Helper * * @var array */ - protected $_defaultConfig = []; + protected array $_defaultConfig = []; /** * Icon getter and modifier (if $options exist). diff --git a/tests/TestCase/Lib/SvgIconTraitTest.php b/tests/TestCase/Lib/SvgIconTraitTest.php index a85906b..b802284 100644 --- a/tests/TestCase/Lib/SvgIconTraitTest.php +++ b/tests/TestCase/Lib/SvgIconTraitTest.php @@ -55,7 +55,7 @@ public function testGet($name, $options, $expected): void * * @return array */ - public function provideGet(): array + public static function provideGet(): array { return SvgIconTraitTest::getProvider(); } diff --git a/tests/TestCase/View/Helper/SvgIconHelperTest.php b/tests/TestCase/View/Helper/SvgIconHelperTest.php index 3eea809..0baf5bc 100644 --- a/tests/TestCase/View/Helper/SvgIconHelperTest.php +++ b/tests/TestCase/View/Helper/SvgIconHelperTest.php @@ -68,7 +68,7 @@ public function testGet($name, $options, $expected): void * * @return array */ - public function provideGet(): array + public static function provideGet(): array { return SvgIconTraitTest::getProvider(); }