-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Request API vs IRequest interface #147
Comments
@dg Any thoughts? I think this needs to be resolved before stable 3.0 version. |
For the next version there are plans to move to middleware and there will be probably a lot of changes. So currently I do not want make a BC break and we'll solve it the next time. |
I really think this needs to be solved now, because of BC break introduced in #90. Please, tell me if I'm missing some crucial point. The following code works just fine in Nette 2.4.x: class Foo
{
/** @var Nette\Http\Request */
private $request;
public function __construct(Nette\Http\Request $request)
{
$this->request = $request;
}
public function bar(): void
{
if ($this->request->isSameSite()) {
// whatava
}
} As far as I know, there is no way how to make it work in Nette 3.x. I can't use directly |
I reverted fix for #90. |
Request
implements a couple of extra methods that are not defined inIRequest
interface. Nette 3 deprecated autowiring ofRequest
type, only autowiring via interface is now supported. This means that those extra methods are basically "inaccessible" for any consumer. I think those methods should be either added to the interface, or deprecated and eventually removed.getReferer(): ?Url
- the interface already mentions this method in@method
annotation, the annotation should be transformed to a proper method definition.isSameSite(): bool
- this should be definitely added to the interface.detectLanguage(array $langs): ?string
- this can be easily extracted to a separate service and removed fromRequest
.What are your thoughts? Shall I send a PR(s)?
Related to #137, #90
The text was updated successfully, but these errors were encountered: