Skip to content

Commit fbfadcb

Browse files
authored
Merge pull request #2 from loadsys/f/cakephp-50
f/cakephp 50
2 parents d556f4e + be48305 commit fbfadcb

8 files changed

Lines changed: 43 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php-version: ['8.1', '8.2']
14+
php-version: ['8.2', '8.3']
1515
name: PHP ${{ matrix.php-version }}
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
@@ -35,12 +35,12 @@ jobs:
3535
runs-on: ubuntu-latest
3636

3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3939

4040
- name: Setup PHP
4141
uses: shivammathur/setup-php@v2
4242
with:
43-
php-version: '8.2'
43+
php-version: '8.3'
4444
extensions: mbstring, intl
4545
coverage: none
4646

@@ -52,4 +52,4 @@ jobs:
5252

5353
- name: Run phpstan
5454
if: success() || failure()
55-
run: vendor/bin/phpstan analyse src/ tests/
55+
run: vendor/bin/phpstan analyse

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/composer.phar
33
/phpunit.xml
44
/.phpunit.result.cache
5+
/.phpunit.cache
56
/phpunit.phar
67
/config/Migrations/schema-dump-default.lock
78
/vendor/

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SvgIcon plugin for CakePHP 4.x
1+
# SvgIcon plugin for CakePHP 5.x
22

33
![Build Status](https://github.com/loadsys/cakephp-svg-icon/actions/workflows/ci.yml/badge.svg?branch=main)
44

@@ -14,6 +14,11 @@ The recommended way to install composer packages is:
1414
composer require loadsys/cakephp-svg-icon
1515
```
1616

17+
## Versions
18+
19+
* Tags `1.x` are for CakePHP v4.x.
20+
* Tags `2.x` are for CakePHP v5.x.
21+
1722
## Configuration
1823

1924
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).

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"type": "cakephp-plugin",
55
"license": "MIT",
66
"require": {
7-
"php": ">=7.4",
8-
"cakephp/cakephp": "4.*"
7+
"php": ">=8.2",
8+
"cakephp/cakephp": "^5.0"
99
},
1010
"require-dev": {
11-
"cakephp/cakephp-codesniffer": "^4.5",
12-
"phpstan/phpstan": "^1.9",
13-
"phpunit/phpunit": "^9.3"
11+
"cakephp/cakephp-codesniffer": "^5.0",
12+
"phpstan/phpstan": "^1.10",
13+
"phpunit/phpunit": "^10.1"
1414
},
1515
"autoload": {
1616
"psr-4": {

phpunit.xml.dist

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
colors="true"
5-
processIsolation="false"
6-
stopOnFailure="false"
7-
bootstrap="tests/bootstrap.php"
8-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
9-
>
10-
<coverage>
11-
<include>
12-
<directory suffix=".php">src/</directory>
13-
</include>
14-
</coverage>
15-
<php>
16-
<ini name="memory_limit" value="-1"/>
17-
<ini name="apc.enable_cli" value="1"/>
18-
</php>
19-
<!-- Add any additional test suites you want to run here -->
20-
<testsuites>
21-
<testsuite name="SvgIcon">
22-
<directory>tests/TestCase/</directory>
23-
</testsuite>
24-
</testsuites>
25-
<!-- Setup fixture extension -->
26-
<extensions>
27-
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
28-
</extensions>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
colors="true"
4+
processIsolation="false"
5+
stopOnFailure="false"
6+
bootstrap="tests/bootstrap.php"
7+
cacheDirectory=".phpunit.cache"
8+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd">
9+
<php>
10+
<ini name="memory_limit" value="-1"/>
11+
<ini name="apc.enable_cli" value="1"/>
12+
</php>
13+
14+
<!-- Add any additional test suites you want to run here -->
15+
<testsuites>
16+
<testsuite name="app">
17+
<directory>tests/TestCase/</directory>
18+
</testsuite>
19+
</testsuites>
20+
21+
<!-- Load extension for fixtures -->
22+
<extensions>
23+
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
24+
</extensions>
2925
</phpunit>

src/View/Helper/SvgIconHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SvgIconHelper extends Helper
1919
*
2020
* @var array<string, mixed>
2121
*/
22-
protected $_defaultConfig = [];
22+
protected array $_defaultConfig = [];
2323

2424
/**
2525
* Icon getter and modifier (if $options exist).

tests/TestCase/Lib/SvgIconTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testGet($name, $options, $expected): void
5555
*
5656
* @return array
5757
*/
58-
public function provideGet(): array
58+
public static function provideGet(): array
5959
{
6060
return SvgIconTraitTest::getProvider();
6161
}

tests/TestCase/View/Helper/SvgIconHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testGet($name, $options, $expected): void
6868
*
6969
* @return array
7070
*/
71-
public function provideGet(): array
71+
public static function provideGet(): array
7272
{
7373
return SvgIconTraitTest::getProvider();
7474
}

0 commit comments

Comments
 (0)