Skip to content

Commit 328f04a

Browse files
authored
chore(deps): update to SF7 (#2)
1 parent 4fb1655 commit 328f04a

File tree

8 files changed

+170
-166
lines changed

8 files changed

+170
-166
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* text=auto
2+
3+
/.github export-ignore
4+
/Tests export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/phpunit.xml.dist export-ignore

.github/workflows/ci.yaml

Lines changed: 53 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,58 @@
11
name: "CI Tests"
22

33
on:
4-
pull_request:
5-
push:
4+
pull_request:
5+
push:
66

7-
jobs:
8-
tests:
9-
runs-on: ubuntu-latest
10-
continue-on-error: ${{ matrix.can-fail }}
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
include:
15-
# Lowest Deps
16-
- php: 7.1
17-
symfony: 4.4.*
18-
composer-flags: '--prefer-stable --prefer-lowest'
19-
can-fail: false
20-
# LTS with latest stable PHP
21-
- php: 8.1
22-
symfony: 5.4.*
23-
composer-flags: '--prefer-stable'
24-
can-fail: false
25-
# Stable Symfony branches
26-
- php: 7.4
27-
symfony: 4.4.*
28-
composer-flags: '--prefer-stable'
29-
can-fail: false
30-
- php: 8.0
31-
symfony: 6.0.*
32-
composer-flags: '--prefer-stable'
33-
can-fail: false
34-
# Development Symfony branches
35-
- php: 8.1
36-
symfony: 6.1.*@dev
37-
composer-flags: ''
38-
can-fail: false
39-
40-
name: "PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"
41-
42-
steps:
43-
- name: "Checkout"
44-
uses: "actions/checkout@v2"
45-
with:
46-
fetch-depth: 2
47-
48-
- name: "Cache Composer packages"
49-
uses: "actions/cache@v2"
50-
with:
51-
path: "~/.composer/cache"
52-
key: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}"
53-
restore-keys: "php-"
7+
env:
8+
fail-fast: true
9+
PHPUNIT_FLAGS: "-v"
10+
SYMFONY_DEPRECATIONS_HELPER: weak
5411

55-
- name: "Install PHP"
56-
uses: "shivammathur/setup-php@v2"
57-
with:
58-
php-version: "${{ matrix.php }}"
59-
tools: "composer:v2,flex"
60-
61-
- name: "Set Composer stability"
62-
if: "matrix.symfony == '6.1.*@dev'"
63-
run: "composer config minimum-stability dev"
64-
65-
- name: "Install dependencies"
66-
run: "composer update ${{ matrix.composer-flags }} --prefer-dist"
67-
env:
68-
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
69-
70-
- name: "Run PHPUnit Tests"
71-
run: "composer test"
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
name: PHP v${{ matrix.php }}, Symfony v${{ matrix.symfony }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- { php: 8.2, symfony: "6.4.*", composer-flags: '--prefer-dist' } # Lowest deps
21+
- { php: 8.3, symfony: "6.4.*", composer-flags: '--prefer-dist' } # LTS with last stable PHP
22+
- { php: 8.3, symfony: "7.1.*", composer-flags: '--prefer-dist' } # Stable Symfony branches
23+
- { php: 8.4, symfony: "7.2.*", composer-flags: '--prefer-dist' } # Stable Symfony branches
24+
25+
steps:
26+
- name: "Checkout"
27+
uses: "actions/checkout@v4"
28+
with:
29+
fetch-depth: 2
30+
31+
- name: "Install PHP"
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
extensions: curl,mbstring,xdebug
36+
ini-values: date.timezone="Europe/Paris"
37+
coverage: xdebug
38+
tools: "composer:v2,flex"
39+
40+
- name: "Show PHP version"
41+
run: php -v && composer -V
42+
43+
- name: "Cache Composer packages"
44+
uses: "actions/cache@v4"
45+
with:
46+
path: "~/.composer/cache"
47+
key: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}"
48+
restore-keys: "php-"
49+
50+
- name: "Install dependencies"
51+
run: |
52+
perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json
53+
composer update ${{ matrix.composer-flags }} --prefer-dist
54+
env:
55+
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
56+
57+
- name: "Run PHPUnit Tests"
58+
run: "composer test"

composer.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"license": "MIT",
77
"authors": [
88
{
9-
"name": "Dev Choosit",
10-
"email": "dev@choosit.com"
9+
"name": "Dev Spiriit",
10+
"email": "dev@spiriit.com"
1111
}
1212
],
1313
"require": {
14-
"php": ">=7.1",
15-
"symfony/http-client": "^4.4|^5.4|^6.0",
14+
"php": "^8.1",
1615
"ext-dom": "*",
17-
"symfony/serializer": "^4.4|^5.4|^6.0"
16+
"symfony/http-client": "^5.4|^6.4|^7.0",
17+
"symfony/serializer": "^5.4|^6.4|^7.0"
1818
},
1919
"autoload": {
2020
"psr-4": {
@@ -27,18 +27,15 @@
2727
}
2828
},
2929
"require-dev": {
30-
"symfony/yaml": "^4.4|^5.4|^6.0",
31-
"symfony/phpunit-bridge": "^4.4|^5.1|^6.0",
30+
"symfony/yaml": "^5.4|^6.4|^7.0",
3231
"friendsofphp/php-cs-fixer": "*",
33-
"symfony/framework-bundle": "^4.4|^5.4|^6.0",
32+
"symfony/phpunit-bridge": "^5.4|^6.4|^7.0",
33+
"symfony/framework-bundle": "^5.4|^6.4|^7.0",
3434
"phpstan/phpstan": "*",
35+
"rector/rector": "^2.0",
3536
"ekino/phpstan-banned-code": "*",
36-
"vimeo/psalm": "*",
37-
"psalm/plugin-symfony": "*",
38-
"infection/infection": "*"
39-
},
40-
"conflict": {
41-
"symfony/framework-bundle": "<4.4"
37+
"infection/infection": "*",
38+
"symplify/easy-coding-standard": "^12.5"
4239
},
4340
"scripts": {
4441
"test": [

ecs.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the composer-write-changelogs project.
7+
*
8+
* (c) Dev Spiriit <dev@spiriit.com>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
15+
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
16+
use PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer;
17+
use Symplify\EasyCodingStandard\Config\ECSConfig;
18+
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
19+
20+
return static function (ECSConfig $config): void {
21+
$config->sets([SetList::PSR_12]);
22+
$config->rule(OrderedImportsFixer::class);
23+
$config->ruleWithConfiguration(ArraySyntaxFixer::class, [
24+
'syntax' => 'short',
25+
]);
26+
27+
$config->parallel();
28+
$config->paths([__DIR__]);
29+
$config->skip([
30+
__DIR__ . '/.github',
31+
__DIR__ . '/vendor',
32+
PhpdocScalarFixer::class
33+
]);
34+
};

phpunit.xml.dist

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
processIsolation="false"
9-
stopOnFailure="false"
10-
bootstrap="vendor/autoload.php"
11-
executionOrder="random"
12-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
backupGlobals="false"
5+
backupStaticAttributes="false"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
bootstrap="vendor/autoload.php"
12+
convertDeprecationsToExceptions="true"
13+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
1314
>
1415
<coverage>
1516
<include>
16-
<directory>src/</directory>
17+
<directory>./</directory>
1718
</include>
19+
<exclude>
20+
<directory>./Resources</directory>
21+
<directory>./Tests</directory>
22+
<directory>./vendor</directory>
23+
</exclude>
1824
</coverage>
1925

2026
<testsuites>
@@ -24,7 +30,6 @@
2430
</testsuites>
2531

2632
<php>
27-
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5"/>
2833
<env name="KERNEL_CLASS" value="Choosit\ModeloBundle\Tests\Integration\Kernel"/>
2934
<env name="SYMFONY_DECRYPTION_SECRET" value="$_test"/>
3035
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>

psalm.xml

Lines changed: 0 additions & 66 deletions
This file was deleted.

rector.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the composer-write-changelogs project.
7+
*
8+
* (c) Dev Spiriit <dev@spiriit.com>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
use Rector\Config\RectorConfig;
15+
use Rector\Set\ValueObject\SetList;
16+
use Rector\ValueObject\PhpVersion;
17+
18+
return RectorConfig::configure()
19+
->withSkip([
20+
__DIR__ . '/.github',
21+
__DIR__ . '/DependencyInjection/Configuration.php',
22+
__DIR__ . '/vendor',
23+
])
24+
->withPaths([
25+
__DIR__
26+
])
27+
->withPhpVersion(PhpVersion::PHP_84)
28+
->withSets([SetList::PHP_84])
29+
->withImportNames()
30+
->withPreparedSets(
31+
deadCode: true,
32+
typeDeclarations: true,
33+
privatization: true,
34+
earlyReturn: true
35+
);

0 commit comments

Comments
 (0)