Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f/cakephp 50 #2

Merged
merged 3 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -52,4 +52,4 @@ jobs:

- name: Run phpstan
if: success() || failure()
run: vendor/bin/phpstan analyse src/ tests/
run: vendor/bin/phpstan analyse
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/composer.phar
/phpunit.xml
/.phpunit.result.cache
/.phpunit.cache
/phpunit.phar
/config/Migrations/schema-dump-default.lock
/vendor/
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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).
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
50 changes: 23 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>
<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="SvgIcon">
<directory>tests/TestCase/</directory>
</testsuite>
</testsuites>
<!-- Setup fixture extension -->
<extensions>
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
</extensions>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd">
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="app">
<directory>tests/TestCase/</directory>
</testsuite>
</testsuites>

<!-- Load extension for fixtures -->
<extensions>
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
</extensions>
</phpunit>
2 changes: 1 addition & 1 deletion src/View/Helper/SvgIconHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SvgIconHelper extends Helper
*
* @var array<string, mixed>
*/
protected $_defaultConfig = [];
protected array $_defaultConfig = [];

/**
* Icon getter and modifier (if $options exist).
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Lib/SvgIconTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/Helper/SvgIconHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down