Skip to content

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented Sep 24, 2025

Q A
Branch? 4.x
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

Removes some legacy code paths/conditions for older versions of Symfony, Monolog & PHP.

$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../config'));
$loader->load('monolog.php');

if (!class_exists(DebugLoggerConfigurator::class)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Min Symfony always has this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added in Symfony 6.4 with symfony/symfony#51284. I wonder if we should think about bumping the minimum required version of Symfony components in the 3.x branch to 6.4 and do some of the clean up work there already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with the idea, if needed I'll open a PR that bumps Symfony in 3.x.

Comment on lines +89 to +92
$container->registerForAutoconfiguration(ProcessorInterface::class)
->addTag('monolog.processor');
$container->registerForAutoconfiguration(ResettableInterface::class)
->addTag('kernel.reset', ['method' => 'reset']);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Min Monolog always has these interfaces.


if (!empty($processorOptions)) {
if (!$hasConstructorArguments) {
throw new \RuntimeException('Monolog 1.26 or higher is required for the "date_format" and "remove_used_context_fields" options to be used.');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Min Monolog always has PsrLogMessageProcessor with these args.

@HypeMC HypeMC requested a review from GromNaN September 24, 2025 12:22
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also agree to remove Symfony 5.4 compatibility on the 3.x branch to ease maintenance by backporting some of these changes.

@GromNaN
Copy link
Member

GromNaN commented Sep 24, 2025

Thank you @HypeMC.

@GromNaN GromNaN merged commit 2f468ce into symfony:4.x Sep 24, 2025
5 checks passed
@HypeMC HypeMC deleted the remove-legacy-paths branch September 24, 2025 12:52
@HypeMC HypeMC mentioned this pull request Sep 24, 2025
GromNaN added a commit that referenced this pull request Sep 24, 2025
This PR was merged into the 4.x branch.

Discussion
----------

Minor cleanup

| Q             | A
| ------------- | ---
| Branch?       | 4.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Small follow-up to #519

Commits
-------

f9d6d7f Minor cleanup
GromNaN added a commit that referenced this pull request Sep 25, 2025
This PR was merged into the 3.x branch.

Discussion
----------

Require Symfony 6.4 and PHP 8.1

| Q             | A
| ------------- | ---
| Branch?       | 3.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #519 (comment)
| License       | MIT

Bumping Symfony to 6.4 also means bumping PHP to 8.1, as that's the min version supported by that Symfony version.

Commits
-------

d576ff5 Require Symfony 6.4 and PHP 8.1
@HypeMC HypeMC mentioned this pull request Sep 26, 2025
GromNaN added a commit that referenced this pull request Sep 26, 2025
This PR was merged into the 4.x branch.

Discussion
----------

Removed redundant check

| Q             | A
| ------------- | ---
| Branch?       | 4.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Missed this one in #519, the `SwitchUserTokenProcessor` class is always available ([was added in Symfony 5.2](symfony/symfony#37704), min supported is 7.3).

Commits
-------

00b7149 Removed redundant check
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.

4 participants