-
Notifications
You must be signed in to change notification settings - Fork 292
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
ServerRequest::fromGlobals() should use new static()
#212
Comments
static
keyworkstatic
keyword
fromGlobals() : use static keyword
static
keywordnew static()
Oops... my quick search for existing issues came up empty... To Quote @kael-shipman comment on #158
I'm just wanting a few Slim-like methods, The arguments against LSB (PSR7 doesn't define constructor / ServerRequest is a value object) frankly don't make sense to me. But I respect your judgement. Suggestion: add a |
@bkdotcom What about plain old functions? function isXhr(ServerRequestInterface $request)
{
return true;
} IMO that fits better your use case since it would work with any implementation and you don't have to check or make sure that the request is always your request type. |
Currently:
fromGlobals calls
new ServerRequest(...)
. it should callnew static(...)
Workaround is for extended class to extend (recreate) the fromGlobals method (but with static)
The text was updated successfully, but these errors were encountered: