phpstan / phpstan-nette

Nette Framework class reflection extension for PHPStan & framework-specific rules
MIT License
100 stars 35 forks source link

Move redirect() from Presenter to Component #79

Closed MartkCz closed 1 year ago

MartkCz commented 2 years ago

https://github.com/nette/application/blob/master/src/Application/UI/Component.php#L292

https://github.com/nette/application/blob/master/src/Application/UI/Component.php#L308

ondrejmirtes commented 2 years ago

Hi, when this method was last on Presenter? thanks.

MartkCz commented 2 years ago

idk, but v2.4.0 (5 years ago) had these methods in UI\Component https://github.com/nette/application/blob/v2.4.0/src/Application/UI/Component.php#L347-L375

MartkCz commented 2 years ago

v2.3.0 hasn't Component, but PresenterComponent only with redirect method https://github.com/nette/application/blob/v2.3.0/src/Application/UI/PresenterComponent.php#L322-L345

ondrejmirtes commented 2 years ago

The best way forward would be to have /** @return never */ directly in Nette above those methods. Please try to send a PR there first.

spaze commented 2 years ago

I hit the issue earlier today (missing redirectPermanent either on Component or Presenter), so I've created a PR in nette/application https://github.com/nette/application/pull/304

spaze commented 2 years ago

The nette/application PR has been merged, pending release.

ondrejmirtes commented 1 year ago

Since https://github.com/nette/application/pull/304 is merged I think there's no more need for this :)

spaze commented 1 year ago

And the return never tag has now been released in nette/application 3.1.10.