GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( f14ab3...3fc05b )
by Odiseo
05:44 queued 02:20
created

OrderSearchAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusReportPlugin\Controller\Action;
6
7
use FOS\RestBundle\View\View;
8
use FOS\RestBundle\View\ViewHandler;
9
use Odiseo\SyliusReportPlugin\Repository\OrderRepositoryInterface;
10
use Symfony\Component\HttpFoundation\Request;
11
use Symfony\Component\HttpFoundation\Response;
12
13
final class OrderSearchAction
14
{
15
    /** @var OrderRepositoryInterface */
16
    private $orderRepository;
17
18
    /** @var ViewHandler */
19
    private $viewHandler;
20
21
    public function __construct(OrderRepositoryInterface $productRepository, ViewHandler $viewHandler)
22
    {
23
        $this->orderRepository = $productRepository;
24
        $this->viewHandler = $viewHandler;
25
    }
26
27
    public function __invoke(Request $request): Response
28
    {
29
        $orders = $this->orderRepository->findByNumberPart($request->get('number', ''));
30
        $view = View::create($orders);
31
32
        $this->viewHandler->setExclusionStrategyGroups(['Autocomplete']);
33
        $view->getContext()->enableMaxDepth();
34
35
        return $this->viewHandler->handle($view);
36
    }
37
}
38