Skip to content

Conversation

MartinMystikJonas
Copy link
Collaborator

@MartinMystikJonas MartinMystikJonas commented Oct 30, 2024

I made some fixes for compatibility with new PHPStan and Nette,

There is still one error remaining for variables with default values I cannot solve. I am not sure if it is our unintended Latte behaviour. I recall @dg planned some changes to how {default} works.

Variable with defaut value:

{default $someVariableWithDefault = 'default value'}

is now transformed to:

$someVariableWithDefault ??= \array_key_exists('someVariableWithDefault', \get_defined_vars()) ? \null : 'default value';

So variable type is resolved to 'default value'|null instead of 'default value' as it was earlier.

We shuld also bump minimal PHPStan version for compatibility with new release.

@MartinMystikJonas
Copy link
Collaborator Author

@lulco
Copy link
Contributor

lulco commented Nov 4, 2024

@MartinMystikJonas zda sa ze toho dost vela popadalo v testoch. Budes to fixovat?

@MartinMystikJonas
Copy link
Collaborator Author

Popadalo to v tagu {default}, protže Latte změnilo jak je implementovnaý a ta nová syntaxe je pro PHP stan neznámá

@MartinMystikJonas
Copy link
Collaborator Author

Tests should be fixed once this is merged to PHPStan: phpstan/phpstan-src#3624

@lulco
Copy link
Contributor

lulco commented Nov 13, 2024

Ok keď sa to mergne do phpstanu, a prejdú nám testy, môžeš mergovat

@spaze
Copy link
Contributor

spaze commented Dec 20, 2024

phpstan/phpstan-src#3624 has been merged and released in PHPStan 1.12.13/2.0.4. Can you try to rerun the tests to see if this PR can be merged?

@MartinMystikJonas MartinMystikJonas force-pushed the compatibility-updates branch 4 times, most recently from 7e6c81c to 50c56ba Compare January 9, 2025 11:44
@MartinMystikJonas
Copy link
Collaborator Author

@lulco Fixed. But Composer outdated complains because there is PHPStan 2.0. I think we can merge it and work on PHPStan2.0 compatibility later - I tried to update dependecies but there are some BC breaks and I am not sure how difficult it would be to fix.

@lulco
Copy link
Contributor

lulco commented Jan 9, 2025

@lulco Fixed. But Composer outdated complains because there is PHPStan 2.0. I think we can merge it and work on PHPStan2.0 compatibility later - I tried to update dependecies but there are some BC breaks and I am not sure how difficult it would be to fix.

Agree, merge it and use it :)

@lulco lulco merged commit 3bcaa44 into main Jan 9, 2025
30 of 35 checks passed
@lulco lulco deleted the compatibility-updates branch January 9, 2025 19:32
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