Skip to content

Conversation

@dcolt
Copy link
Collaborator

@dcolt dcolt commented Dec 12, 2025

1:1 with the original, minus some dead code.

Added a TokenCollection to have typehinting and other DX for interacting
with Tokens
@dcolt dcolt requested review from bix0r and sunkan December 12, 2025 08:13
<?php declare(strict_types=1);

if (false) {
} elseif (true) {
Copy link
Member

Choose a reason for hiding this comment

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

This should not be ok

default:
break;}

if (false) :
Copy link
Member

Choose a reason for hiding this comment

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

Should we just BAN the ":" syntax?

Copy link
Member

Choose a reason for hiding this comment

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

I think the "old" syntax is supported to allow codestyle of template file.

But I don't think we actually use it.

And for eveything new we use twig also

return;
}

$isAlternative = false;
Copy link
Member

Choose a reason for hiding this comment

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

Unused?

$closer = $tokens->parenthesisCloser($stackPtr);
$found = 0;
if ($tokens->code($closer + 1) === T_WHITESPACE) {
if (strpos($tokens->content($closer + 1), $phpcsFile->eolChar) !== false) {
Copy link
Member

Choose a reason for hiding this comment

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

Replace with str_contains

@dcolt
Copy link
Collaborator Author

dcolt commented Dec 12, 2025

@bix0r I'll wait with this one, as when I spoke with @sunkan he mentioned this is something that was added to make sure other stuff worked.

So hopefully this wont be needed at all and we just just close/remove this.

@dcolt dcolt marked this pull request as draft December 15, 2025 03:15
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.

4 participants