Skip to content

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

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 8.0
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

@OskarStark
Copy link
Contributor

Wow 🤩

@@ -45,34 +43,6 @@ protected function resetService($name): void

return;
Copy link
Member

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+ ?

Copy link
Member Author

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' : ''));
Copy link
Member

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.

Copy link
Member Author

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)

Copy link
Member

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);
Copy link
Member

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 ?

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

@nicolas-grekas nicolas-grekas left a 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;
Copy link
Member Author

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' : ''));
Copy link
Member Author

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);
Copy link
Member Author

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
Copy link
Member Author

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

@nicolas-grekas nicolas-grekas force-pushed the deadcode branch 2 times, most recently from 321cf79 to 38e079e Compare June 4, 2025 10:36
nicolas-grekas added a commit that referenced this pull request Jun 4, 2025
…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
@nicolas-grekas nicolas-grekas merged commit d8b20d5 into symfony:8.0 Jun 4, 2025
7 of 9 checks passed
@nicolas-grekas nicolas-grekas deleted the deadcode branch June 4, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy