`phpdoc_return_self_reference`: allow to set replacement for `self`, as well

Author: estheziaCreated Sep 28, 2025Updated Aug 23, 2026
Labelsstatus/to verifykind/feature requeststatus/stale

Feature request

When using the phpdoc_return_self_reference rule, allow to set replacements for self, as well. It's almost always the better option, as you want the real class to be returned, not the one that was extended. That's why I use static instead of self.

Link to Discussion where feature request was formed

No response

Contribution Checks

  • I have verified if this feature request was already discussed
  • I am familiar with "Feature or bug?"

Source: PHP-CS-Fixer/PHP-CS-Fixer