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

Fix PHPStan for Twig 4.x #4466

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Fix PHPStan for Twig 4.x #4466

merged 1 commit into from
Nov 30, 2024

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Nov 22, 2024

Hi @fabpot, to help introducing PHPStan on 4.x, I made the merge 3.x into 4.x

  • Fixing the conflits
  • Fixing PHPStan build

I have

  • A commit with the merge 6a82e16

  • A commit with the update needed to get PHPStan build green in 4.x cb89b75

src/Environment.php Show resolved Hide resolved
src/Node/EmptyNode.php Outdated Show resolved Hide resolved
src/Runtime/LoopIterator.php Show resolved Hide resolved
@fabpot
Copy link
Contributor

fabpot commented Nov 22, 2024

@VincentLanglet I've just merged 3.x into 4.x to keep this PR only about phpstan.

@fabpot fabpot changed the title Merge 3.x into 4.x PHPStan for Twig 4.x Nov 22, 2024
@fabpot fabpot changed the title PHPStan for Twig 4.x Fix PHPStan for Twig 4.x Nov 22, 2024
src/ExpressionParser.php Outdated Show resolved Hide resolved
src/Runtime/LoopIterator.php Show resolved Hide resolved
@VincentLanglet
Copy link
Contributor Author

Can you add a test that would break without this change?

For the iterable/Iterator issue, I think it's an issue with PHPStan instead.
So I created an issue on phpstan/phpstan#12102 (and a fix on phpstan side)

@fabpot
Copy link
Contributor

fabpot commented Nov 22, 2024

Can you add a test that would break without this change?

For the iterable/Iterator issue, I think it's an issue with PHPStan instead. So I created an issue on phpstan/phpstan#12102 (and a fix on phpstan side)

Let's revert the change then.

@VincentLanglet
Copy link
Contributor Author

Can you add a test that would break without this change?

For the iterable/Iterator issue, I think it's an issue with PHPStan instead. So I created an issue on phpstan/phpstan#12102 (and a fix on phpstan side)

Let's revert the change then.

I reverted the extra if I added.

We still need /** @var \Iterator<TKey, TValue> $seq */ to not lose the template type.

@VincentLanglet
Copy link
Contributor Author

I rebased @fabpot

@fabpot
Copy link
Contributor

fabpot commented Nov 30, 2024

Thank you @VincentLanglet.

@fabpot fabpot merged commit f9f9653 into twigphp:4.x Nov 30, 2024
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants