Closed spaze closed 1 year ago
Do you have phpstan-nette extension? I think this is config which is used to supress those errors: https://github.com/efabrica-team/phpstan-latte/blob/main/tests/config.neon#L9
Oh, nice, thanks. I had phpstan-nette loaded in the other phpstan.neon
but not in the one that does phpstan-latte checks. Do you think the requirement should be documented in the Installation section? And maybe even have phpstan/phpstan-nette
in require
in composer.json
?
I was thinking about it too. It definitelly should be in docs. I am not sure about composer, because you have to add it to your phpstan config anyways, right?
Hm, it seems method redirectPermanent is missing in phpstan extension.
https://github.com/phpstan/phpstan-nette/blob/1.1.x/extension.neon#L31
I am not sure about composer, because you have to add it to your phpstan config anyways, right?
Sure, but adding it to composer.json
too would allow the docs to have one manual step less :-) Unless there's a situation where you may not need phpstan-nette.
Hm, it seems method redirectPermanent is missing in phpstan extension.
https://github.com/phpstan/phpstan-nette/blob/1.1.x/extension.neon#L31
And I thought I've already hit the issue and added it :| PR'd it now https://github.com/phpstan/phpstan-nette/pull/113
Oh, I thought... and I actually did, that's why it rang a bell. But the fix was in Nette, still pending release https://github.com/phpstan/phpstan-nette/pull/79#issuecomment-1152794607 + https://github.com/nette/application/pull/304
I think never
return typehint shouldn’t be precondition to add method to earlyterminatingmethodcalls
. Still, you can add it in your app until it will be in phpstan-nette
I think it's more of the fix than a precondition for adding but yeah, I have it in my config for like half a year, since at least creating the PR, with a note to remove it.
And the return never
tag has now been released in nette/application 3.1.10 (but the extension doesn't seem to care much, see #261)
These actions have no templates, so maybe these shouldn't be reported?
"26 Cannot resolve latte template for action default" link uses
redirect()
https://github.com/spaze/michalspacek.cz/blob/71fd6075535830d05fe927ea9465e95acccb7133/site/app/Admin/Presenters/SignPresenter.php#L26-L29 "71 Cannot resolve latte template for action out" link https://github.com/spaze/michalspacek.cz/blob/71fd6075535830d05fe927ea9465e95acccb7133/site/app/Admin/Presenters/SignPresenter.php#L71-L77 both actions just redirect, but no error reported here https://github.com/spaze/michalspacek.cz/blob/71fd6075535830d05fe927ea9465e95acccb7133/site/app/Admin/Presenters/SignPresenter.php#L32-L39 (also redirects)" 23 Cannot resolve latte template for action default" link The method uses
sendJson()
: https://github.com/spaze/michalspacek.cz/blob/71fd6075535830d05fe927ea9465e95acccb7133/site/app/Api/Presenters/ErrorPresenter.php#L23"19 Cannot resolve latte template for action default" link Uses
sendResponse()
: https://github.com/spaze/michalspacek.cz/blob/71fd6075535830d05fe927ea9465e95acccb7133/site/app/Pulse/Presenters/ErrorPresenter.php#L21"22 Cannot resolve latte template for action storagesQuestions" link + "33 Cannot resolve latte template for action storagesRating" link Both actions use
redirectPermanent()
https://github.com/spaze/michalspacek.cz/blob/71fd6075535830d05fe927ea9465e95acccb7133/site/app/Pulse/Presenters/PasswordsPresenter.php#L24