Skip to content

Commit c19a766

Browse files
committed
Upgrade to PHP 8.2+, Symfony 6.4/7.4/8.0, replace Psalm with PHPStan
- PHP requirement bumped to >=8.2; CI matrix moved to PHP 8.2/8.3/8.4 - Symfony constraints widened to ^6.4 || ^7.4 || ^8.0; CI pins per row - Replace Psalm with PHPStan (level 8) via setono/code-quality-pack ^3.4 - Replace composer-unused with shipmonk/composer-dependency-analyser - Migrate PHPUnit 9 → 11 (#[Test] attribute, schema rewrite) - Migrate service config from XML to PHP DSL for Symfony 8 readiness - Port ecs.php to ECSConfig builder - Switch codecov uploader to codecov/codecov-action@v5
1 parent 78276c1 commit c19a766

19 files changed

Lines changed: 174 additions & 170 deletions

.gitattributes

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
* text=auto
2-
31
/.github export-ignore
42
/tests export-ignore
53
/.editorconfig export-ignore
64
/.gitattributes export-ignore
75
/.gitignore export-ignore
8-
/composer-unused.php export-ignore
9-
/composer-require-checker.json export-ignore
6+
/composer-dependency-analyser.php export-ignore
107
/ecs.php export-ignore
11-
/infection.json.dist export-ignore
8+
/phpstan.neon.dist export-ignore
129
/phpunit.xml.dist export-ignore
13-
/psalm.xml export-ignore
1410
/README.md export-ignore

.github/dependabot.yml

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

.github/workflows/build.yaml

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
strategy:
1616
matrix:
1717
php-version:
18-
- "7.4"
18+
- "8.2"
1919

2020
dependencies:
2121
- "highest"
2222

2323
steps:
2424
- name: "Checkout"
25-
uses: "actions/checkout@v3"
25+
uses: "actions/checkout@v6"
2626

2727
- name: "Setup PHP, with composer and extensions"
2828
uses: "shivammathur/setup-php@v2"
@@ -32,7 +32,7 @@ jobs:
3232
coverage: "none"
3333

3434
- name: "Install composer dependencies"
35-
uses: "ramsey/composer-install@v2"
35+
uses: "ramsey/composer-install@v3"
3636
with:
3737
dependency-versions: "${{ matrix.dependencies }}"
3838

@@ -53,45 +53,45 @@ jobs:
5353
strategy:
5454
matrix:
5555
php-version:
56-
- "7.4"
57-
- "8.0"
58-
- "8.1"
56+
- "8.2"
57+
- "8.3"
58+
- "8.4"
5959

6060
dependencies:
6161
- "highest"
6262

6363
symfony:
64-
- "^5.4"
65-
- "^6.0"
64+
- "~6.4.0"
65+
- "~7.4.0"
66+
- "~8.0.0"
6667

6768
exclude:
68-
- php-version: "7.4"
69-
symfony: "^6.0"
69+
- php-version: "8.2"
70+
symfony: "~8.0.0"
71+
- php-version: "8.3"
72+
symfony: "~8.0.0"
7073

7174
steps:
7275
- name: "Checkout"
73-
uses: "actions/checkout@v3"
76+
uses: "actions/checkout@v6"
7477

7578
- name: "Setup PHP, with composer and extensions"
7679
uses: "shivammathur/setup-php@v2"
7780
with:
7881
coverage: "none"
7982
extensions: "${{ env.PHP_EXTENSIONS }}"
8083
php-version: "${{ matrix.php-version }}"
81-
tools: "composer-require-checker, composer-unused, flex"
84+
tools: "flex"
8285

8386
- name: "Install composer dependencies"
84-
uses: "ramsey/composer-install@v2"
87+
uses: "ramsey/composer-install@v3"
8588
with:
8689
dependency-versions: "${{ matrix.dependencies }}"
8790
env:
8891
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
8992

90-
- name: "Run maglnet/composer-require-checker"
91-
run: "composer-require-checker check"
92-
93-
- name: "Run composer-unused/composer-unused"
94-
run: "composer-unused"
93+
- name: "Run shipmonk/composer-dependency-analyser"
94+
run: "vendor/bin/composer-dependency-analyser"
9595

9696
static-code-analysis:
9797
name: "Static Code Analysis"
@@ -101,24 +101,27 @@ jobs:
101101
strategy:
102102
matrix:
103103
php-version:
104-
- "7.4"
105-
- "8.0"
106-
- "8.1"
104+
- "8.2"
105+
- "8.3"
106+
- "8.4"
107107

108108
dependencies:
109109
- "highest"
110110

111111
symfony:
112-
- "^5.4"
113-
- "^6.0"
112+
- "~6.4.0"
113+
- "~7.4.0"
114+
- "~8.0.0"
114115

115116
exclude:
116-
- php-version: "7.4"
117-
symfony: "^6.0"
117+
- php-version: "8.2"
118+
symfony: "~8.0.0"
119+
- php-version: "8.3"
120+
symfony: "~8.0.0"
118121

119122
steps:
120123
- name: "Checkout"
121-
uses: "actions/checkout@v3"
124+
uses: "actions/checkout@v6"
122125

123126
- name: "Setup PHP, with composer and extensions"
124127
uses: "shivammathur/setup-php@v2"
@@ -129,14 +132,14 @@ jobs:
129132
tools: "flex"
130133

131134
- name: "Install composer dependencies"
132-
uses: "ramsey/composer-install@v2"
135+
uses: "ramsey/composer-install@v3"
133136
with:
134137
dependency-versions: "${{ matrix.dependencies }}"
135138
env:
136139
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
137140

138141
- name: "Static analysis"
139-
run: "vendor/bin/psalm --php-version=${{ matrix.php-version }}"
142+
run: "vendor/bin/phpstan analyse --no-progress"
140143

141144
unit-tests:
142145
name: "Unit tests"
@@ -146,25 +149,28 @@ jobs:
146149
strategy:
147150
matrix:
148151
php-version:
149-
- "7.4"
150-
- "8.0"
151-
- "8.1"
152+
- "8.2"
153+
- "8.3"
154+
- "8.4"
152155

153156
dependencies:
154157
- "lowest"
155158
- "highest"
156159

157160
symfony:
158-
- "^5.4"
159-
- "^6.0"
161+
- "~6.4.0"
162+
- "~7.4.0"
163+
- "~8.0.0"
160164

161165
exclude:
162-
- php-version: "7.4"
163-
symfony: "^6.0"
166+
- php-version: "8.2"
167+
symfony: "~8.0.0"
168+
- php-version: "8.3"
169+
symfony: "~8.0.0"
164170

165171
steps:
166172
- name: "Checkout"
167-
uses: "actions/checkout@v3"
173+
uses: "actions/checkout@v6"
168174

169175
- name: "Setup PHP, with composer and extensions"
170176
uses: "shivammathur/setup-php@v2"
@@ -175,7 +181,7 @@ jobs:
175181
tools: "flex"
176182

177183
- name: "Install composer dependencies"
178-
uses: "ramsey/composer-install@v2"
184+
uses: "ramsey/composer-install@v3"
179185
with:
180186
dependency-versions: "${{ matrix.dependencies }}"
181187
env:
@@ -192,14 +198,14 @@ jobs:
192198
strategy:
193199
matrix:
194200
php-version:
195-
- "8.1"
201+
- "8.4"
196202

197203
dependencies:
198204
- "highest"
199205

200206
steps:
201207
- name: "Checkout"
202-
uses: "actions/checkout@v3"
208+
uses: "actions/checkout@v6"
203209

204210
- name: "Setup PHP, with composer and extensions"
205211
uses: "shivammathur/setup-php@v2"
@@ -208,18 +214,16 @@ jobs:
208214
extensions: "${{ env.PHP_EXTENSIONS }}"
209215
php-version: "${{ matrix.php-version }}"
210216

211-
- name: "Set up problem matchers for phpunit/phpunit"
212-
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
213-
214217
- name: "Install composer dependencies"
215-
uses: "ramsey/composer-install@v2"
218+
uses: "ramsey/composer-install@v3"
216219
with:
217220
dependency-versions: "${{ matrix.dependencies }}"
218221

219222
- name: "Collect code coverage with pcov and phpunit/phpunit"
220223
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"
221224

222225
- name: "Send code coverage report to Codecov.io"
223-
env:
224-
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
225-
run: "bash <(curl -s https://codecov.io/bash)"
226+
uses: "codecov/codecov-action@v5"
227+
with:
228+
token: "${{ secrets.CODECOV_TOKEN }}"
229+
files: ".build/logs/clover.xml"

CLAUDE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project
6+
7+
Symfony bundle that wires the [`setono/gls-webservice-php-sdk`](https://github.com/Setono/gls-webservice-php-sdk) into a Symfony application's DI container. The bundle itself contains no business logic — it loads an XML service definition file that registers the SDK's `SoapClientFactory` and `Client`, and exposes `wsdl` / `connection_timeout` as configurable parameters.
8+
9+
Supports PHP `>=7.4` and Symfony `^5.4 || ^6.0`. The CI matrix tests PHP 7.4 / 8.0 / 8.1 against both Symfony lines (excluding PHP 7.4 + Symfony 6).
10+
11+
## Common commands
12+
13+
Composer scripts (also exposed as zsh aliases — see user-level CLAUDE.md):
14+
15+
- `composer phpunit` (`phpunit`) — run the test suite.
16+
- `composer analyse` (`ca`) — Psalm static analysis.
17+
- `composer check-style` — ECS style check (read-only).
18+
- `composer fix-style` (`cf`) — ECS auto-fix.
19+
- `composer-require-checker check` (`crc`) — surface undeclared dependencies.
20+
- `composer-unused` — surface unused composer dependencies. `composer-unused.php` contains a `NamedFilter` for `setono/gls-webservice-php-sdk` because that package is wired only through XML and so appears unused to static analysis; do not remove the filter.
21+
22+
Run a single test: `vendor/bin/phpunit --filter it_inits` (or pass a path: `vendor/bin/phpunit tests/SetonoGlsWebserviceBundleTest.php`).
23+
24+
## Architecture
25+
26+
Three files do all the work; understand them as a unit:
27+
28+
- `src/SetonoGlsWebserviceBundle.php` — empty `Bundle` subclass; the framework derives the extension class name (`SetonoGlsWebserviceExtension`) by convention.
29+
- `src/DependencyInjection/Configuration.php` — defines the `setono_gls_webservice` config tree (`wsdl`, `connection_timeout`).
30+
- `src/DependencyInjection/SetonoGlsWebserviceExtension.php` — processes config into two container parameters (`setono_gls_webservice.wsdl`, `setono_gls_webservice.options`) and loads `Resources/config/services.xml`. Note that `connection_timeout` is only added to `options` when `> 0` — falsy values are intentionally omitted so the `SoapClient` uses its own default.
31+
- `src/Resources/config/services.xml` — instantiates `SoapClientFactory` and `Client` from the SDK and registers FQCN aliases (`Setono\GLS\Webservice\Client\ClientInterface`, `Setono\GLS\Webservice\Factory\SoapClientFactoryInterface`) so consumers can autowire by interface. When adding a new service, register both the snake-case id and the interface alias to preserve this convention.
32+
33+
Tests use `nyholm/symfony-bundle-test`'s `TestKernel`. The integration test in `tests/SetonoGlsWebserviceBundleTest.php` registers a compiler pass that marks every `setono.*` service / alias public so the assertions can fetch them from the container — required because the bundle's services are private by default.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022-present Setono
3+
Copyright (c) 2026 Setono
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer-dependency-analyser.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
6+
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
7+
8+
return (new Configuration())
9+
->addPathToExclude(__DIR__ . '/tests')
10+
->ignoreErrorsOnExtension('ext-soap', [ErrorType::UNUSED_DEPENDENCY])
11+
;

composer-unused.php

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

composer.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@
99
"gls"
1010
],
1111
"require": {
12-
"php": ">=7.4",
12+
"php": ">=8.2",
1313
"ext-soap": "*",
14-
"setono/gls-webservice-php-sdk": "^2.0",
15-
"symfony/config": "^5.4 || ^6.0",
16-
"symfony/dependency-injection": "^5.4 || ^6.0",
17-
"symfony/http-kernel": "^5.4 || ^6.0"
14+
"setono/gls-webservice-php-sdk": "^2.2",
15+
"symfony/config": "^6.4 || ^7.4 || ^8.0",
16+
"symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
17+
"symfony/http-kernel": "^6.4 || ^7.4 || ^8.0"
1818
},
1919
"require-dev": {
20-
"matthiasnoback/symfony-config-test": "^4.3",
21-
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
22-
"nyholm/symfony-bundle-test": "^2.0",
23-
"phpunit/phpunit": "^9.5",
24-
"psalm/plugin-phpunit": "^0.17",
25-
"psalm/plugin-symfony": "^3.1",
26-
"roave/security-advisories": "dev-latest",
27-
"setono/code-quality-pack": "^2.2"
20+
"matthiasnoback/symfony-config-test": "^6.2",
21+
"matthiasnoback/symfony-dependency-injection-test": "^6.3",
22+
"nyholm/symfony-bundle-test": "^3.1",
23+
"phpstan/phpstan-symfony": "^2.0",
24+
"phpunit/phpunit": "^11.5",
25+
"setono/code-quality-pack": "^3.4",
26+
"shipmonk/composer-dependency-analyser": "^1.8"
2827
},
2928
"prefer-stable": true,
3029
"autoload": {
@@ -40,12 +39,14 @@
4039
"config": {
4140
"allow-plugins": {
4241
"dealerdirect/phpcodesniffer-composer-installer": false,
43-
"ergebnis/composer-normalize": true
42+
"ergebnis/composer-normalize": true,
43+
"infection/extension-installer": true,
44+
"phpstan/extension-installer": true
4445
},
4546
"sort-packages": true
4647
},
4748
"scripts": {
48-
"analyse": "psalm",
49+
"analyse": "phpstan analyse",
4950
"check-style": "ecs check",
5051
"fix-style": "ecs check --fix",
5152
"phpunit": "phpunit"

ecs.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
declare(strict_types=1);
44

5-
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6-
use Symplify\EasyCodingStandard\ValueObject\Option;
5+
use Symplify\EasyCodingStandard\Config\ECSConfig;
76

8-
return static function (ContainerConfigurator $config): void {
9-
$config->import('vendor/sylius-labs/coding-standard/ecs.php');
10-
$config->parameters()->set(Option::PATHS, [
11-
'src', 'tests'
7+
return ECSConfig::configure()
8+
->withPaths([
9+
__DIR__ . '/src',
10+
__DIR__ . '/tests',
11+
])
12+
->withSets([
13+
__DIR__ . '/vendor/sylius-labs/coding-standard/ecs.php',
1214
]);
13-
};

0 commit comments

Comments
 (0)