1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @license MIT, http://opensource.org/licenses/MIT |
||
5 | * @copyright Aimeos (aimeos.org), 2015-2016 |
||
6 | * @package symfony |
||
7 | * @subpackage Controller |
||
8 | */ |
||
9 | |||
10 | |||
11 | namespace Aimeos\ShopBundle\Controller; |
||
12 | |||
13 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
||
14 | use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory; |
||
15 | use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory; |
||
16 | use Symfony\Component\HttpFoundation\Response; |
||
17 | use Symfony\Component\HttpFoundation\Request; |
||
18 | use Nyholm\Psr7\Factory\Psr17Factory; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * Aimeos controller for the /admin/{site}/graphql route |
||
23 | * |
||
24 | * @package symfony |
||
25 | * @subpackage Controller |
||
26 | */ |
||
27 | class GraphqlController extends AbstractController |
||
28 | { |
||
29 | /** |
||
30 | * Returns the initial HTML view for the admin interface. |
||
31 | * |
||
32 | * @param Request $request Symfony request object |
||
33 | * @return Response Generated HTML page for the admin interface |
||
34 | */ |
||
35 | public function indexAction( Request $request, \Twig\Environment $twig ) : \Symfony\Component\HttpFoundation\Response |
||
36 | { |
||
37 | $site = $request->get( 'site', 'default' ); |
||
38 | $lang = $request->get( 'locale', 'en' ); |
||
39 | |||
40 | $context = $this->container->get( 'aimeos.context' )->get( false, 'backend' ); |
||
41 | $context->setI18n( $this->container->get( 'aimeos.i18n' )->get( array( $lang, 'en' ) ) ); |
||
42 | $context->setLocale( $this->container->get( 'aimeos.locale' )->getBackend( $context, $site ) ); |
||
43 | $context->setView( $this->container->get( 'aimeos.view' )->create( $context, [], $lang ) ); |
||
44 | |||
45 | return $this->createResponse( \Aimeos\Admin\Graphql::execute( $context, $this->createRequest( $request ) ) ); |
||
0 ignored issues
–
show
|
|||
46 | } |
||
47 | |||
48 | |||
49 | protected function createRequest( Request $reqest ) : \Psr\Http\Message\RequestInterface |
||
50 | { |
||
51 | $psr17Factory = new Psr17Factory(); |
||
52 | $psrHttpFactory = new PsrHttpFactory( $psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory ); |
||
53 | |||
54 | return $psrHttpFactory->createRequest( $reqest ); |
||
55 | } |
||
56 | |||
57 | |||
58 | protected function createResponse( \Psr\Http\Message\ResponseInterface $response ) : Response |
||
59 | { |
||
60 | $httpFoundationFactory = new HttpFoundationFactory(); |
||
61 | return $httpFoundationFactory->createResponse( $response ); |
||
62 | } |
||
63 | } |
||
64 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths