phpstan-nette icon indicating copy to clipboard operation
phpstan-nette copied to clipboard

Move redirect() from Presenter to Component

Open MartkCz opened this issue 4 years ago • 6 comments

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

MartkCz avatar Oct 07 '21 18:10 MartkCz

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

ondrejmirtes avatar Oct 07 '21 21:10 ondrejmirtes

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 avatar Oct 11 '21 14:10 MartkCz

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

MartkCz avatar Oct 11 '21 14:10 MartkCz

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

ondrejmirtes avatar Oct 11 '21 14:10 ondrejmirtes

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 avatar Jun 10 '22 23:06 spaze

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

spaze avatar Jun 15 '22 17:06 spaze

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

ondrejmirtes avatar Jan 12 '23 07:01 ondrejmirtes

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

spaze avatar Jan 17 '23 17:01 spaze