-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Remove deadcode after the bump to PHP >= 8.4 #60666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nicolas-grekas
commented
Jun 3, 2025
Q | A |
---|---|
Branch? | 8.0 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Issues | - |
License | MIT |
Wow 🤩 |
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
@@ -45,34 +43,6 @@ protected function resetService($name): void | |||
|
|||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the if ($manager instanceof LazyObjectInterface) {
above also dead code ? Or is there still a case where we use a LazyObjectInterface of var-exporter instead of a native lazy object on PHP 8.4+ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LazyObjectInterface is not deprecated, it's still used for lazy decorators, which is the remaining feature on the topic.
@@ -177,7 +173,7 @@ | |||
$prevCacheDir = false; | |||
} | |||
} | |||
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : '')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we really dropping support for older PHPUnit versions ? There is a difference between the default version and the supported versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
older phpunit versions don't support PHP 8, but we bumped the bridge to PHP >= 8.1 (to keep using it when testing Symfony 6.4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need a proper cleanup to remove all code related to using older PHPUnit versions then. For instance, there is no need to remove the prophecy dependency in PHPUnit 9.6 anymore (as it is not installed by default anymore).
And we probably need a check on $PHPUNIT_VERSION
to fail properly if the env variable specifies an unsupported PHPUnit version.
} | ||
|
||
return static::createFromFormat('U.u', \sprintf('%.6F', $timestamp)); | ||
return parent::createFromTimestamp($timestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we drop the method override entirely now that we don't need to polyfill it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the decoration remains for the static
return type, which is more accurate than the native one
} | ||
/** | ||
* @internal | ||
* @deprecated since Symfony 7.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding a @deprecated since Symfony 7.3
annotation that was not there before is suspicious to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added as a reminder this should removed while removing the deprecated traits
the annotation was not needed because @internal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments addressed @stof, thanks for the review!
@@ -45,34 +43,6 @@ protected function resetService($name): void | |||
|
|||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LazyObjectInterface is not deprecated, it's still used for lazy decorators, which is the remaining feature on the topic.
@@ -177,7 +173,7 @@ | |||
$prevCacheDir = false; | |||
} | |||
} | |||
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : '')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
older phpunit versions don't support PHP 8, but we bumped the bridge to PHP >= 8.1 (to keep using it when testing Symfony 6.4)
} | ||
|
||
return static::createFromFormat('U.u', \sprintf('%.6F', $timestamp)); | ||
return parent::createFromTimestamp($timestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the decoration remains for the static
return type, which is more accurate than the native one
} | ||
/** | ||
* @internal | ||
* @deprecated since Symfony 7.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added as a reminder this should removed while removing the deprecated traits
the annotation was not needed because @internal
321cf79
to
38e079e
Compare
…ekas) This PR was merged into the 8.0 branch. Discussion ---------- Remove deadcode after the bump to PHP >= 8.4 | Q | A | ------------- | --- | Branch? | 8.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- 38e079e Remove deadcode after the bump to PHP >= 8.4