-
Notifications
You must be signed in to change notification settings - Fork 183
Symfony3 support (merged forks) #283
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
Changes from 1 commit
c15f204
6c0d24a
5a5aaf0
f502d35
e7e0ca5
e8f7956
fd2752f
c78c9a7
f824ef8
cd4d911
e3a8d89
ce904d7
1837ca1
d0c3481
f5843ea
e367a88
b865d10
946e99e
77bf522
0608251
aa9eaf5
c334607
90912fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| namespace FOS\MessageBundle\FormHandler; | ||
|
|
||
| use Symfony\Component\Form\Form; | ||
| use Symfony\Component\HttpFoundation\Request; | ||
| use Symfony\Component\HttpFoundation\RequestStack; | ||
| use FOS\MessageBundle\Composer\ComposerInterface; | ||
| use FOS\MessageBundle\FormModel\AbstractMessage; | ||
| use FOS\MessageBundle\Security\ParticipantProviderInterface; | ||
|
|
@@ -22,9 +22,9 @@ abstract class AbstractMessageFormHandler | |
| protected $sender; | ||
| protected $participantProvider; | ||
|
|
||
| public function __construct(Request $request, ComposerInterface $composer, SenderInterface $sender, ParticipantProviderInterface $participantProvider) | ||
| public function __construct(RequestStack $requestStack, ComposerInterface $composer, SenderInterface $sender, ParticipantProviderInterface $participantProvider) | ||
| { | ||
| $this->request = $request; | ||
| $this->request = $requestStack->getCurrentRequest(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The request must not be retrieved in the constructor. /**
* @param Request|RequestStack $request
*/
public function __construct($request, ...) {
if ($request instanceof Request) {
@trigger_error(sprintf('Using an instance of "%s" as first parameter of "%s" is deprecated since version 1.3 and won\'t be supported in 2.0. Use an instance of "Symfony\Component\HttpFoundation\RequestStack" instead.', get_class($request), __METHOD), E_USER_DEPRECATED);
}
$this->request = $request;
// ...
}
private function getCurrentRequest() {
if ($this->request instanceof Request) {
return $this->request;
}
return $this->request->getCurrentRequest();
}
public function process() {
// ...
$request = $this->getCurrentRequest();
} |
||
| $this->composer = $composer; | ||
| $this->sender = $sender; | ||
| $this->participantProvider = $participantProvider; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,8 +58,8 @@ | |
| <tag name="twig.extension" alias="fos_message" /> | ||
| </service> | ||
|
|
||
| <service id="fos_message.search_query_factory.default" class="FOS\MessageBundle\Search\QueryFactory" scope="request" public="true"> | ||
| <argument type="service" id="request" /> | ||
| <service id="fos_message.search_query_factory.default" class="FOS\MessageBundle\Search\QueryFactory" public="true"> | ||
| <argument type="service" id="request_stack" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be managed in a compiler pass or we must remove support of @tgalopin do you agree to bump sf constraints to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't, 2.3 is still supported and we should as well. I'll create a CompilerPass.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2.3 only receives security fixes and it's really easy to upgrade to a higher version. I don't think we should give people an argument to not upgrade.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, that's wrong, 2.3 is not supported anymore. Let's drop it yes. |
||
| <argument /> <!-- query parameter containing the search terms --> | ||
| </service> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,15 +2,15 @@ | |
|
|
||
| namespace FOS\MessageBundle\Search; | ||
|
|
||
| use Symfony\Component\HttpFoundation\Request; | ||
| use Symfony\Component\HttpFoundation\RequestStack; | ||
|
|
||
| /** | ||
| * Gets the search term from the request and prepares it | ||
| */ | ||
| class QueryFactory implements QueryFactoryInterface | ||
| { | ||
| /** | ||
| * @var Request | ||
| * @var \Symfony\Component\HttpFoundation\Request | ||
| */ | ||
| protected $request = null; | ||
|
|
||
|
|
@@ -24,12 +24,12 @@ class QueryFactory implements QueryFactoryInterface | |
| /** | ||
| * Instanciates a new TermGetter | ||
| * | ||
| * @param Request $request | ||
| * @param RequestStack $requestStack | ||
| * @param string $queryParameter | ||
| */ | ||
| public function __construct(Request $request, $queryParameter) | ||
| public function __construct(RequestStack $requestStack, $queryParameter) | ||
| { | ||
| $this->request = $request; | ||
| $this->request = $requestStack->getCurrentRequest(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be implemented as described earlier |
||
| $this->queryParameter = $queryParameter; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bc break