Merge branch '2.8'
* 2.8: [HttpKernel] Fix RequestStack argument position and deprecated behavior Conflicts: src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php
This commit is contained in:
commit
79d2e8e95f
@ -21,10 +21,10 @@
|
||||
<service id="profiler_listener" class="Symfony\Component\HttpKernel\EventListener\ProfilerListener">
|
||||
<tag name="kernel.event_subscriber" />
|
||||
<argument type="service" id="profiler" />
|
||||
<argument type="service" id="request_stack" />
|
||||
<argument type="service" id="profiler.request_matcher" on-invalid="null" />
|
||||
<argument>%profiler_listener.only_exceptions%</argument>
|
||||
<argument>%profiler_listener.only_master_requests%</argument>
|
||||
<argument type="service" id="request_stack" />
|
||||
</service>
|
||||
</services>
|
||||
</container>
|
||||
|
@ -41,7 +41,7 @@ class LazyLoadingFragmentHandler extends FragmentHandler
|
||||
if ((null !== $requestStack && !$requestStack instanceof RequestStack) || $debug instanceof RequestStack) {
|
||||
$tmp = $debug;
|
||||
$debug = $requestStack;
|
||||
$requestStack = $tmp;
|
||||
$requestStack = func_num_args() < 3 ? null : $tmp;
|
||||
|
||||
@trigger_error('The '.__METHOD__.' method now requires a RequestStack to be given as second argument as '.__CLASS__.'::setRequest method will not be supported anymore in 3.0.', E_USER_DEPRECATED);
|
||||
} elseif (!$requestStack instanceof RequestStack) {
|
||||
|
@ -48,11 +48,11 @@ class LocaleListener implements EventSubscriberInterface
|
||||
*/
|
||||
public function __construct($requestStack = null, $defaultLocale = 'en', $router = null)
|
||||
{
|
||||
if (is_string($requestStack) || $defaultLocale instanceof RequestContextAwareInterface || $router instanceof RequestStack) {
|
||||
if ((null !== $requestStack && !$requestStack instanceof RequestStack) || $defaultLocale instanceof RequestContextAwareInterface || $router instanceof RequestStack) {
|
||||
$tmp = $router;
|
||||
$router = $defaultLocale;
|
||||
$router = func_num_args() < 2 ? null : $defaultLocale;
|
||||
$defaultLocale = $requestStack;
|
||||
$requestStack = $tmp;
|
||||
$requestStack = func_num_args() < 3 ? null : $tmp;
|
||||
|
||||
@trigger_error('The '.__METHOD__.' method now requires a RequestStack to be given as first argument as '.__CLASS__.'::setRequest method will not be supported anymore in 3.0.', E_USER_DEPRECATED);
|
||||
} elseif (!$requestStack instanceof RequestStack) {
|
||||
|
@ -41,12 +41,12 @@ class ProfilerListener implements EventSubscriberInterface
|
||||
* Constructor.
|
||||
*
|
||||
* @param Profiler $profiler A Profiler instance
|
||||
* @param RequestStack $requestStack A RequestStack instance
|
||||
* @param RequestMatcherInterface|null $matcher A RequestMatcher instance
|
||||
* @param bool $onlyException true if the profiler only collects data when an exception occurs, false otherwise
|
||||
* @param bool $onlyMasterRequests true if the profiler only collects data when the request is a master request, false otherwise
|
||||
* @param RequestStack|null $requestStack A RequestStack instance
|
||||
*/
|
||||
public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false, RequestStack $requestStack = null)
|
||||
public function __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false)
|
||||
{
|
||||
$this->profiler = $profiler;
|
||||
$this->matcher = $matcher;
|
||||
|
@ -52,9 +52,9 @@ class FragmentHandler
|
||||
{
|
||||
if (is_array($requestStack)) {
|
||||
$tmp = $debug;
|
||||
$debug = $renderers;
|
||||
$debug = func_num_args() < 2 ? false : $renderers;
|
||||
$renderers = $requestStack;
|
||||
$requestStack = $tmp;
|
||||
$requestStack = func_num_args() < 3 ? null : $tmp;
|
||||
|
||||
@trigger_error('The '.__METHOD__.' method now requires a RequestStack to be given as first argument as '.__CLASS__.'::setRequest method will not be supported anymore in 3.0.', E_USER_DEPRECATED);
|
||||
} elseif (!$requestStack instanceof RequestStack) {
|
||||
|
@ -56,7 +56,7 @@ class ProfilerListenerTest extends \PHPUnit_Framework_TestCase
|
||||
$requestStack->push($masterRequest);
|
||||
|
||||
$onlyException = true;
|
||||
$listener = new ProfilerListener($profiler, null, $onlyException, false, $requestStack);
|
||||
$listener = new ProfilerListener($profiler, $requestStack, null, $onlyException);
|
||||
|
||||
// master request
|
||||
$listener->onKernelResponse(new FilterResponseEvent($kernel, $masterRequest, Kernel::MASTER_REQUEST, $response));
|
||||
|
Reference in New Issue
Block a user