Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

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

@samsonasik
Copy link
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
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
Copy link
Contributor

simonschaufi commented Oct 6, 2025

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
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
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
Member Author

Fixed and released 2.2.1 for it

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

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