Skip to content

Legacy Bridge v5.0.10

Choose a tag to compare

@se7enxweb se7enxweb released this 03 Aug 18:30
· 4 commits to 5.x since this release

Legacy Bridge v5.0.10

What changed

This is a PHP 8.4 compatibility release. No new features were added and no public API was changed. The entire diff is limited to method/constructor signatures.

Added explicit nullable types

PHP 8.4 deprecates implicit nullable parameter declarations such as:

public function __construct(LoggerInterface $logger = null)

This release replaces every occurrence with the explicit form:

public function __construct(?LoggerInterface $logger = null)

Files affected include:

  • bundle/Routing/FallbackRouter.php
  • bundle/Command/LegacyBundleInstallCommand.php
  • bundle/Cache/PersistenceCachePurger.php
  • bundle/LegacyMapper/Session.php
  • bundle/Exception/NotFoundHttpException.php
  • bundle/Controller/WebsiteToolbarController.php
  • bundle/DependencyInjection/Configuration/LegacyConfigResolver.php
  • mvc/Kernel.php
  • mvc/Kernel/CLIHandler.php
  • mvc/Kernel/Loader.php
  • mvc/EventListener/APIContentExceptionListener.php
  • mvc/View/Provider.php
  • and additional mvc/SignalSlot/*, mvc/Templating/*, bundle/Tests/*, and bundle/DependencyInjection/* files.

Fixed optional-parameter-before-required

LegacyBundleInstallCommand::linkLegacyExtension() had an optional array $options parameter before a required OutputInterface $output parameter, which PHP 8.4 now treats as implicitly required. The signature and call site were re-ordered:

protected function linkLegacyExtension($extensionPath, OutputInterface $output, array $options = [])

Collapsed accidental double nullables

During the bulk signature update, any parameters that were already declared as ?Type were briefly changed to ??Type. A second pass collapsed these back to the correct ?Type.

Why this matters for Composer users

  • PHP 8.4 readiness: Install this release before migrating your host to PHP 8.4 to avoid E_DEPRECATED storms.
  • Clean logs: php bin/console cache:clear --env=prod no longer produces hundreds of "Implicitly marking parameter as nullable" messages.
  • Strict CI support: Pipelines that use error_reporting = E_ALL or phpstan/psalm with strict deprecation checks now pass.
  • No runtime changes: Behavior of every public method is unchanged; only parameter declarations were made explicit. This is a safe patch-level upgrade.
  • No public API break: Existing code that passes null, an object, or omits an optional argument continues to work exactly as before.

Upgrade

composer require se7enxweb/legacy-bridge:^5.0.10

Or bump the constraint in composer.json:

"se7enxweb/legacy-bridge": "^5.0.10"

Then run composer update se7enxweb/legacy-bridge.

Full diff

See the commit for the complete list of files and the exact signature changes.