-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Deprecate AddAnnotatedClassesToCachePass
and related code infrastructure
#53801
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,14 @@ | |
use Symfony\Component\ErrorHandler\DebugClassLoader; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
trigger_deprecation('symfony/http-kernel', '7.1', 'The "%s" class is deprecated since Symfony 7.1 and will be removed in 8.0.', AddAnnotatedClassesToCachePass::class); | ||
|
||
/** | ||
* Sets the classes to compile in the cache for the container. | ||
* | ||
* @author Fabien Potencier <[email protected]> | ||
* | ||
* @deprecated since Symfony 7.1, to be removed in 8.0 | ||
*/ | ||
class AddAnnotatedClassesToCachePass implements CompilerPassInterface | ||
{ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
* Allow adding classes to the class cache. | ||
* | ||
* @author Fabien Potencier <[email protected]> | ||
* | ||
* @internal since Symfony 7.1, to be deprecated in 8.1; use Symfony\Component\DependencyInjection\Extension\Extension instead | ||
*/ | ||
abstract class Extension extends BaseExtension | ||
{ | ||
|
@@ -26,19 +28,27 @@ abstract class Extension extends BaseExtension | |
* Gets the annotated classes to cache. | ||
* | ||
* @return string[] | ||
* | ||
* @deprecated since Symfony 7.1, to be removed in 8.0 | ||
*/ | ||
public function getAnnotatedClassesToCompile(): array | ||
{ | ||
trigger_deprecation('symfony/http-kernel', '7.1', 'The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.', __METHOD__); | ||
|
||
return $this->annotatedClasses; | ||
} | ||
|
||
/** | ||
* Adds annotated classes to the class cache. | ||
* | ||
* @param string[] $annotatedClasses An array of class patterns | ||
* | ||
* @deprecated since Symfony 7.1, to be removed in 8.0 | ||
*/ | ||
public function addAnnotatedClassesToCompile(array $annotatedClasses): void | ||
{ | ||
trigger_deprecation('symfony/http-kernel', '7.1', 'The "%s()" method is deprecated since Symfony 7.1 and will be removed in 8.0.', __METHOD__); | ||
|
||
$this->annotatedClasses = array_merge($this->annotatedClasses, $annotatedClasses); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 cannot deprecate this class right away in 7.1 because we rely on it in FrameworkBundle and others.
Making it first internal then deprecate in 8.1 provides a smooth upgrade path.
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.
Actually, if it is already a no-op, FrameworkBundle could stop registering it.
Uh oh!
There was an error while loading. Please reload this page.
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.
if you mean AddAnnotatedClassesToCachePass, that's done in this PR
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.
ah, I see. This is about the base class then.
Marking as
@internal
first which removes it from our BC policy before deprecating it only in 8.1 looks weird to me. If we don't deprecate it, we might keep it as non-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.
it's
@internal since
, which means its deprecated to use, but we signals to us we won't remove it in 8.0 for BC reasonsThere 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.
but
@internal since 7.1
would become@internal
in 8.0, which can be removed.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 but doesn't have to, while deprecated means it should be removed
I'm looking for a smoother plan
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.
fine by me