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

Compatibility fixes for new versions of PHPStan and Nette #460

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

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?

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