Completed
Push — master ( ba8ed9...770316 )
by Jeroen
06:11
created

Controller/AbstractSearchPageController.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\NodeSearchBundle\Controller;
4
5
use Kunstmaan\NodeBundle\Helper\RenderContext;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Symfony\Component\HttpFoundation\Request;
8
9
/**
10
 * Class AbstractSearchPageController
11
 */
12
class AbstractSearchPageController extends Controller
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Bundle\Framework...e\Controller\Controller has been deprecated with message: since Symfony 4.2, use "Symfony\Bundle\FrameworkBundle\Controller\AbstractController" instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
13
{
14
    /**
15
     * @param Request $request
16
     */
17
    public function serviceAction(Request $request)
18
    {
19
        if ($request->query->has('query')) {
20
            $search = $this->container->get('kunstmaan_node_search.search.service');
21
            $pagerfanta = $search->search();
22
            /** @var RenderContext $renderContext */
23
            $renderContext = $search->getRenderContext();
24
            $renderContext['pagerfanta'] = $pagerfanta;
25
26
            $request->attributes->set('_renderContext', $renderContext);
27
        }
28
    }
29
}
30