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

Allow TRUE instead of \TRUE #1038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow TRUE instead of \TRUE #1038

wants to merge 1 commit into from

Conversation

chx
Copy link

@chx chx commented Oct 23, 2024

I am working on a Rector rule which converts a very large chunk of the remaining procedural code in Drupal to OOP. (Run!)

One problem we found the converted code contains \TRUE instead of TRUE. While of course \TRUE is totally correct, people wanted TRUE and who am I to disagree? I added this to a visitor:

                    if (isset($node->name) && $node->name instanceof FullyQualified) {
                        $name = new Node\Name($node->name);
                        if ($name->isUnqualified()) {
                            $node->name = $name;
                            return $node;
                        }
                    }

that's quite the hassle though. So I am proposing a property on FullyQualified to start the discussion and if you find it acceptable then I'd add an option to NameResolver which sets this to FALSE. Thanks for your consideration -- and the amazing library.

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.

1 participant