/**
  * {@inheritdoc}
  */
 public function getResources(RequestConfiguration $requestConfiguration, RepositoryInterface $repository)
 {
     if (!$requestConfiguration->hasGrid()) {
         return $this->decoratedResolver->getResources($requestConfiguration, $repository);
     }
     $gridDefinition = $this->gridProvider->get($requestConfiguration->getGrid());
     $request = $requestConfiguration->getRequest();
     $parameters = new Parameters($request->query->all());
     $gridView = $this->gridViewFactory->create($gridDefinition, $parameters, $requestConfiguration->getMetadata(), $requestConfiguration);
     if ($requestConfiguration->isHtmlRequest()) {
         return $gridView;
     }
     return $gridView->getData();
 }
 function it_returns_grid_data_for_non_html_requests(RequestConfiguration $requestConfiguration, RepositoryInterface $repository, Grid $gridDefinition, GridProviderInterface $gridProvider, ResourceGridViewFactoryInterface $gridViewFactory, ResourceGridView $gridView, Pagerfanta $paginator, MetadataInterface $metadata, Request $request, ParameterBag $queryParameters)
 {
     $requestConfiguration->hasGrid()->willReturn(true);
     $requestConfiguration->getGrid()->willReturn('sylius_admin_tax_category');
     $requestConfiguration->getMetadata()->willReturn($metadata);
     $requestConfiguration->isHtmlRequest()->willReturn(false);
     $requestConfiguration->getRequest()->willReturn($request);
     $request->query = $queryParameters;
     $queryParameters->all()->willReturn(['foo' => 'bar']);
     $gridProvider->get('sylius_admin_tax_category')->willReturn($gridDefinition);
     $gridViewFactory->create($gridDefinition, Argument::type(Parameters::class), $metadata, $requestConfiguration)->willReturn($gridView);
     $gridView->getData()->willReturn($paginator);
     $this->getResources($requestConfiguration, $repository)->shouldReturn($paginator);
 }