PHANTOM
🇮🇳 IN
Skip to content

Clean up types#19278

Open
ADmad wants to merge 1 commit into6.xfrom
types-cleanup
Open

Clean up types#19278
ADmad wants to merge 1 commit into6.xfrom
types-cleanup

Conversation

@ADmad
Copy link
Member

@ADmad ADmad commented Feb 15, 2026

No description provided.

@ADmad ADmad added this to the 6.0 milestone Feb 15, 2026
@LordSimal
Copy link
Contributor

Is there a PHPCS or stan rule for the __clone() change maybe?

@ADmad
Copy link
Member Author

ADmad commented Feb 15, 2026

Is there a PHPCS or stan rule for the __clone() change maybe?

Couldn't find anything after a quick search. psalm does report it though :)

@LordSimal
Copy link
Contributor

psalm does report it though :)

gotta re-add psalm then :D

@dereuromark
Copy link
Member

Slevomat's ReturnTypeHintSniff at line 213:

$methodsWithoutVoidSupport = ['__construct' => true, '__destruct' => true, '__clone' => true];

This means the sniff will not require : void on __clone(), __construct(), or __destruct().

But not sure if it would also remove or alert the additional one.

@dereuromark
Copy link
Member

Seems like a simple sniff addition: php-collective/code-sniffer#48
I Just made it a feature flag for BC for now, but it can sure be added as a real new sniff as well.

@ADmad
Copy link
Member Author

ADmad commented Feb 16, 2026

gotta re-add psalm then :D

Maybe we should. It's pretty fast and does seem to be quite good at catching generics/templates related issues currently. For e.g. it reported the docblock type mismatch for PaginatedResultSet::__construct() which phpstan didn't.

@LordSimal
Copy link
Contributor

it reported the docblock type mismatch for PaginatedResultSet::__construct() which phpstan didn't.

Is this an actual bug in PHPStan or is this something that only gets reported by PHPStan by higher levels or extensions?

If its a bug it would be awesome if it could be made minimally reproducable and report it to phpstan.

@ADmad
Copy link
Member Author

ADmad commented Feb 22, 2026

Is this an actual bug in PHPStan or is this something that only gets reported by PHPStan by higher levels or extensions?

We have disabled/ignored the missingType.generics identifier. So it's possible that's why it doesn't check the validity of related annotations.

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