Skip to content

Commit

Permalink
Update for Kint 6
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Nov 20, 2024
1 parent d758470 commit bff1986
Show file tree
Hide file tree
Showing 8 changed files with 1,375 additions and 805 deletions.
98 changes: 24 additions & 74 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- uses: actions/cache@v3
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
Expand All @@ -29,10 +31,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- uses: actions/cache@v3
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
Expand All @@ -47,10 +51,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- uses: actions/cache@v3
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
Expand Down Expand Up @@ -81,13 +87,24 @@ jobs:
twig:
- 2
- 3
exclude:
# Twig 2 is EOL and breaks in 8.4
- php-versions: 8.4
twig: 2
# Twig 3 doesn't support < 8.1
- php-versions: 7.4
twig: 3
- php-versions: 8.0
twig: 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- uses: actions/cache@v3
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
Expand All @@ -98,70 +115,3 @@ jobs:
- run: composer require twig/twig ^${{ matrix.twig }}
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit --no-coverage tests
old-tests:
name: 'PHP ${{ matrix.php-versions }} Twig ${{ matrix.twig }} tests'
needs:
- test-format
- test-static
- test-basic
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions:
- 7.2
- 7.3
twig:
- 2
- 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- uses: actions/cache@v3
id: vendor-caches
with:
path: |
./vendor
key: old-${{ matrix.twig }}-${{ hashFiles('./composer.lock') }}
- run: composer remove --dev friendsofphp/php-cs-fixer phpunit/phpunit phpspec/prophecy-phpunit vimeo/psalm
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer config platform.php 7.2.9
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer require twig/twig ^${{ matrix.twig }}
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer require --dev phpunit/phpunit ^7
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit --no-coverage tests
older-tests:
name: 'PHP 7.1 Twig 2 tests'
needs:
- test-format
- test-static
- test-basic
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 7.1
- uses: actions/cache@v3
id: vendor-caches
with:
path: |
./vendor
key: older-${{ hashFiles('./composer.lock') }}
- run: composer remove --dev friendsofphp/php-cs-fixer phpunit/phpunit phpspec/prophecy-phpunit vimeo/psalm
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer config platform.php 7.1.3
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer require twig/twig ^2
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer require --dev phpunit/phpunit ^7
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit --no-coverage tests
18 changes: 9 additions & 9 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'dir_constant' => true,
'escape_implicit_backslashes' => [
'single_quoted' => true,
'string_implicit_backslashes' => [
'single_quoted' => 'escape',
],
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
Expand Down Expand Up @@ -78,7 +78,9 @@
],
'sort_algorithm' => 'none',
],
'php_unit_construct' => true,
'php_unit_construct' => [
'assertions' => ['assertSame', 'assertNotSame'],
],
'php_unit_dedicate_assert' => true,
'php_unit_namespaced' => true,
'php_unit_set_up_tear_down_visibility' => true,
Expand All @@ -100,10 +102,8 @@
'position' => 'end',
],
'no_null_property_initialization' => false,
'trailing_comma_in_multiline' => [
'elements' => ['array_destructuring', 'arrays', 'match'],
],
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(['build', 'tests/Fixtures'])
->append([__FILE__])
);
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__));
21 changes: 10 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{
"name": "kint-php/kint-twig",
"description": "Twig extension for Kint integration",
"keywords": ["dump", "debug", "twig"],
"type": "library",
"homepage": "https://kint-php.github.io/kint/",
"license": "GPL-3.0",
"require": {
"php": ">=7.1",
"kint-php/kint": "^4 || ^5",
"twig/twig": "^2.4 || ^3.0"
"php": ">=7.4",
"kint-php/kint": "^6",
"twig/twig": "^2.4 || ^3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
"vimeo/psalm": "^5",
"phpunit/phpunit": "^9.0"
"phpunit/phpunit": "^9"
},
"config": {
"platform": {
"php": "8.2"
"php": "8.3"
}
},
"autoload": {
Expand All @@ -27,18 +30,14 @@
"Kint\\Test\\Twig\\": "tests/"
}
},
"license": "GPL-3.0",
"authors": [
{
"name": "Jonathan Vollebregt",
"email": "[email protected]"
}
],
"scripts": {
"format": [
"@format:php"
],
"format:php": "php-cs-fixer fix",
"analyze": "psalm --show-info=false"
"format": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix",
"analyze": "psalm --no-cache"
}
}
Loading

0 comments on commit bff1986

Please sign in to comment.