Skip to content
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

Remove dependency on Nette\Http\Request #131

Merged
merged 3 commits into from
Oct 19, 2024

Conversation

Rixafy
Copy link
Contributor

@Rixafy Rixafy commented Oct 13, 2024

Hi, there was a problem when you try to use this exntesion with php runtimes like swoole/roadrunner/falconphp, because you can't have Nette Request object, but you need your own implementation of IRequest that will switch its variables and state between requests.

The problem wasn't only Header resolver itself, because if you are not using it, extension will try to create it in DI and it fails in constructor, so extension could not work at all, so I moved one method for resolving locale from Nette Request to Header resolver.

@aleswita
Copy link
Member

jelikoz nas to nezbavi zavislosti na Nette/Http, tak bych se asi nebal udelat neco takoveho

return (new Request(
	$this->httpRequest->getUrl(),
	headers: $this->httpRequest->getHeaders()
))->detectLanguage($langs);

nez kopirovat kod

@Rixafy
Copy link
Contributor Author

Rixafy commented Oct 15, 2024

Great, that looks better, I did it in one line because of come codesniffer errors (tabs were used): nevermind.. fixed.

45 | ERROR | [x] Multi-line function call not indented correctly; expected 8 spaces but found 12 (PSR2.Methods.FunctionCallSignature.Indent)
45 | ERROR | [x] Closing parenthesis of a multi-line function call must be on a line by itself (PSR2.Methods.FunctionCallSignature.CloseBracketLine)

@aleswita aleswita merged commit 6d3e42d into contributte:master Oct 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants