Skip to content
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

Draft: hide class-level template types from static members #2232

Open
wants to merge 5 commits into
base: 1.10.x
Choose a base branch
from

Conversation

jiripudil
Copy link
Contributor

This is a solution I was talking about previously.

The failing test discovered exactly the kind of class-string magic I was afraid people might be doing. I don't know how many actual real-life use cases there are, but it puts doubt in my mind about this.

Nevertheless, I still firmly believe this is a must for static properties, which, sadly, I have no idea how to cover in this way.

@ondrejmirtes
Copy link
Member

Added a few commits so that this is ready for static methods if we decide to go with it :) But yeah, the CarFactoryProcessor example is somewhat reasonable even for static method.

About static properties - yeah, that might not be trivial at all :/ Because when retrieving PHPDocs, FileTypeMapper is handed these parameters:

	public function getResolvedPhpDoc(
		?string $fileName,
		?string $className,
		?string $traitName,
		?string $functionName,
		string $docComment,
	): ResolvedPhpDocBlock

We don't know when we're getting a PHPDoc for a property, they're not stored separately :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants