Skip to content

[AutoImport] Allow on FQCN current same class (part 2)#7235

Merged
samsonasik merged 4 commits into
mainfrom
allow-auto-improt
Sep 10, 2025
Merged

[AutoImport] Allow on FQCN current same class (part 2)#7235
samsonasik merged 4 commits into
mainfrom
allow-auto-improt

Conversation

@samsonasik

Copy link
Copy Markdown
Member

@samsonasik

Copy link
Copy Markdown
Member Author

phpstan notice on packages phpstan is unrelated, I will ignore/fix there first ...

@samsonasik

Copy link
Copy Markdown
Member Author

@samsonasik samsonasik changed the title [AutoImport] Allow on FQCN current same class [AutoImport] Allow on FQCN current same class (part 2) Sep 10, 2025
@samsonasik

Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it to have faster feedback to test ;)

@samsonasik samsonasik merged commit 078f193 into main Sep 10, 2025
49 checks passed
@samsonasik samsonasik deleted the allow-auto-improt branch September 10, 2025 12:18
@simonschaufi

simonschaufi commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

This PR breaks within TYPO3 Rector for PHP 7.4. See sabbelasichon/typo3-rector#4673 @TomasVotruba It appears only on PHP 7.4. I can't reproduce it on PHP 8 anymore. The problem is shown here:

https://3v4l.org/OWiEF#v8.0.0 -> "" -> strtolower works

https://3v4l.org/OWiEF#v7.4.33 -> false -> strtolower throws an exception


$shortNameLowered = $fullyQualifiedObjectType->getShortNameLowered();
$fullyQualifiedObjectTypeNamespace = strtolower(
substr($fullyQualifiedObjectType->getClassName(), 0, -strlen($fullyQualifiedObjectType->getShortName()) - 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@samsonasik is the last -1 really correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will look into it

@samsonasik

Copy link
Copy Markdown
Member Author

Fixed and released 2.2.1 for it

https://github.com/rectorphp/rector/releases/tag/2.2.1

@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants