Skip to content

fix: clear PHP 8.5 deprecations and widen dependency constraints across packages - #695

Open
dgafka wants to merge 13 commits into
mainfrom
fix/deprecations
Open

fix: clear PHP 8.5 deprecations and widen dependency constraints across packages#695
dgafka wants to merge 13 commits into
mainfrom
fix/deprecations

Conversation

@dgafka

@dgafka dgafka commented Aug 16, 2026

Copy link
Copy Markdown
Member

Why is this change proposed?

Several of Ecotone's own dependency constraints (phpstan, guzzlehttp/psr7, symfony/uid, kwn/php-rdkafka-stubs, symplify/monorepo-builder, phpunit) were pinned well below their current majors, blocking consumers from installing newer versions alongside Ecotone. Composer.lock isn't committed in this repo, so each environment resolves independently against its own PHP version — widening a constraint to an OR-range (rather than replacing it) is safe, since older PHP targets keep resolving the older majors automatically.

This closes a tier-by-tier widening pass across all 15 packages, plus the deprecation fixes needed to keep test suites clean once PHP 8.5 and PHPUnit 12 are in the mix.

Out of scope

  • doctrine/doctrine-bundle 2.x→3.x migration (would unlock the Symfony 8.1 chain) — reverted after a config-removal issue surfaced; tracked as a separate follow-up.
  • Pre-existing monorepo-builder validate drift (doctrine/orm, doctrine/persistence, Tempest's php>=8.4 requirement, quickstart-examples wildcard versions) — unrelated to this pass.

Description of Changes

Dependency widening

  • phpstan/phpstan: allow ^2.0 across the remaining packages.
  • guzzlehttp/psr7: allow ^3.0 in Laravel and LiteApplication.
  • kwn/php-rdkafka-stubs: allow ^3.0 in Kafka.
  • symfony/uid: allow newer majors.
  • symplify/monorepo-builder: 11.1.21^12.0.
  • phpunit/phpunit: allow ^12.0 everywhere, kept below ^13.0 (needs PHP ≥8.4.1, which would drop PHP 8.2 support).

Deprecation and compatibility fixes

  • Clear PHP 8.5 nullable-parameter deprecations by allowing guzzlehttp/promises v2 and predis/predis v2.
  • Avoid the deprecated PDO::MYSQL_ATTR_SSL_CA constant and a null array-offset deprecation in DbaBusinessMethodModule.
  • Migrate deprecated PHPUnit XML schema in the remaining phpunit.xml(.dist) files.
  • Fix PHPUnit 12's stricter #[RequiresPhp] version-string parsing and two createMock() calls flagged for having no configured expectations.
  • Fix a real timing race in GracefulShutdownOnSignalTest, where PHPUnit 12's added per-test overhead made a self-sent SIGTERM reliably beat Ecotone's signal-handler registration.

Pull Request Contribution Terms

  • I have read and agree to the contribution terms outlined in CONTRIBUTING.

dgafka added 13 commits August 12, 2026 08:00
PHP 8.5 deprecates using null as an array offset. Fall back to the
interface parameter name when the DbalParameter attribute has no
explicit name, matching the key already used to register its header.
PDO::MYSQL_ATTR_SSL_CA is deprecated since PHP 8.5 in favour of
Pdo\Mysql::ATTR_SSL_CA. Guard on class_exists() so the test config
still works on PHP 8.2/8.3, where Pdo\Mysql does not exist yet.
JmsConverter, LiteApplication, OpenTelemetry, Redis and Sqs still
validated against the old PHPUnit 9.5 schema, which PHPUnit 11
reports as a runtime deprecation. Migrated via
vendor/bin/phpunit --migrate-configuration to the 11.5 schema,
matching the other packages.
predis/predis 1.1.10 triggers several "implicitly nullable parameter"
deprecations on PHP 8.5. It is a require-dev (test-only) dependency,
so widen the constraint to allow 2.x; the test suite passes unchanged
against 2.4.1.
…recations

guzzlehttp/promises 1.5.3 triggers several "implicitly nullable
parameter" deprecations on PHP 8.5. It is a require-dev (test-only)
dependency, so widen the constraint to allow 2.x; the test suite
passes unchanged against 2.5.2.
…n/php-rdkafka-stubs

These were pinned below their latest major even though nothing in the
root project requires the old major. symfony/uid resolves to 8.1.4 and
kwn/php-rdkafka-stubs to 3.0.1 with this change; guzzlehttp/psr7 stays
on 2.x for now since guzzlehttp/guzzle 7.x itself caps it to ^2.13.
IDE-stub-only package with no runtime code, resolves to 3.0.1.
No-op today since guzzlehttp/guzzle 7.x still caps psr7 to ^2.13, but
removes the constraint as a blocker once guzzle itself is bumped.
Root composer.json already allowed ^1.8|^2.0; sync the 13 package-level
composer.json files to match so they aren't stuck resolving 1.12.x.
All 13 packages resolve to 2.2.8 and pass with zero new errors.
Resolves to 12.7.2, which fixes the tool's own PHP 8.5 deprecation
noise from its bundled (namespaced) Symfony DI/Console components.
Custom release workers in Monorepo/ keep working unchanged - the
internal classes they depend on (DependencyUpdater,
ComposerJsonProvider, PackageNamesProvider, VersionUtils) only moved
from packages/ to src/ internally, same namespaces. Also syncs
monorepo-builder.php's dataToAppend phpstan/phpstan constraint with
the ^1.8|^2.0 already used across packages since the Tier 2 bump.
Verified per-package on fresh installs (PHP 8.5): all 15 packages'
full suites pass with phpunit resolving to 12.5.33, zero new
failures. On PHP 8.2 the same widened constraint keeps resolving
11.5.x automatically (phpunit 12 requires php >=8.3) - spot-checked
via the symlink:false isolation technique on packages/Ecotone.

Fixes found and applied along the way, all confirmed unrelated to
which phpunit major is in use:
- RequiresPhp('>= 8.5') attributes in three Dbal/Ecotone tests were
  flagged as "incomplete version requirement" by phpunit 12's
  stricter parser; PharIo's version comparator wants full semver.
- GracefulShutdownOnSignalTest sends itself a raw SIGTERM after a
  hardcoded 300ms sleep, racing bootstrapFlowTesting() + Ecotone's
  consumer registering its signal handler. Under phpunit 12's added
  per-test overhead the race lost reliably, killing the whole
  process before the handler was installed. Bumped the pre-signal
  delay to 1s; the timing assertion itself is unaffected since it's
  measured from run() start, not process start.
- Two tests (Enqueue's InboundMessageConverterTest, Symfony's
  SymfonyMessengerMessageChannelUnitTest) passed unused dependencies
  via createMock() with no expectations ever set - exactly what
  phpunit 12's new "no expectations configured" notice flags.
  Switched to createStub().

phpunit/phpunit stays capped below ^12.0 as the floor (not raised to
^12.0 only) because PHP 8.2 is still an explicitly supported/tested
target (app8_2 container, split-testing.yml CI matrix) - phpunit 13
requires php>=8.4.1 so it's excluded entirely, unlike 12 which only
needs php>=8.3 and simply won't be selected under 8.2.

Also syncs monorepo-builder.php's dataToAppend phpunit constraint to
match.
…tCase

PHPUnit 12 made TestCase::__construct() final with a mandatory string
argument, so FullAppBenchmarkCase could no longer override it to supply
a default benchmark name. But PHPBench instantiates benchmark classes
with `new $class()` (no arguments, see phpbench's remote.template), so
any zero-arg instantiation of a class ultimately extending TestCase now
fatals with an ArgumentCountError.

FullAppBenchmarkCase served two different roles: a shared base for real
PHPUnit tests (FullAppTestCase, ProxyCacheGenerationTest, run via
vendor/bin/phpunit) and a shared base for PHPBench-only benchmark
subjects (AsynchronousStackBenchmark, HttpStackBenchmark,
EventSourcingBenchmark, BootingEcotoneBenchmark, KernelBootBenchmark).

Extract the shared behavior into FullAppBenchmarkCaseTrait. The
PHPUnit-facing FullAppBenchmarkCase class keeps extending TestCase
(PHPUnit constructs its own TestCase subclasses, passing the test
method name itself, so the final constructor is not an issue there).
The PHPBench-only benchmark classes now extend PHPUnit\Framework\Assert
instead (for their assertCount/assertSame helpers) and use the trait
directly, avoiding TestCase's constructor entirely.
…ding

FullAppBenchmarkCase.php defined both the FullAppBenchmarkCase class and
a same-file FullAppBenchmarkCaseTrait. Composer's default (non-optimized)
PSR-4 autoloader only resolves a symbol whose name matches its containing
file, so the trait was unresolvable at runtime unless the containing file
happened to be required first — this repo doesn't set
optimize-autoloader, and CI's composer update doesn't pass -o, so
PHPBench's reflector process (which autoloads the benchmark classes
fresh) fataled with "Trait ... not found" for every PHPBench-only
subclass (AsynchronousStackBenchmark, HttpStackBenchmark,
EventSourcingBenchmark, BootingEcotoneBenchmark, KernelBootBenchmark).

Move the trait into its own FullAppBenchmarkCaseTrait.php, matching this
codebase's one-symbol-per-file convention everywhere else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant