Skip to content

ClassNameCheck: Retrieve extensions just once#4926

Open
staabm wants to merge 4 commits intophpstan:2.1.xfrom
staabm:once
Open

ClassNameCheck: Retrieve extensions just once#4926
staabm wants to merge 4 commits intophpstan:2.1.xfrom
staabm:once

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 14, 2026

No description provided.

@staabm staabm marked this pull request as ready for review February 14, 2026 08:56
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

private Container $container,
)
{
$this->extensions = $this->container->getServicesByTag(RestrictedClassNameUsageExtension::CLASS_NAME_EXTENSION_TAG);
Copy link
Member

Choose a reason for hiding this comment

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

I don't want to do stuff in constructor, you're risking circular references. It has to be done lazily with ??= and nullable property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahh right. we had this discussion already. I forgot.

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.

3 participants