Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison committed Aug 22, 2022
1 parent 695d2cb commit 4631a51
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Admin/SharedBlockAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
namespace Sonata\PageBundle\Admin;

use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\BlockBundle\Block\Service\EditableBlockService;
use Sonata\BlockBundle\Model\BlockInterface;
use Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQuery;
use Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQueryInterface as DatagridProxyInterface;
use Sonata\PageBundle\Model\PageBlockInterface;

/**
Expand All @@ -38,9 +39,12 @@ protected function generateBaseRouteName(bool $isChildAdmin = false): string
return sprintf('%s_%s', parent::generateBaseRouteName($isChildAdmin), 'shared');
}

/**
* @return DatagridProxyInterface
*/
protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterface
{
\assert($query instanceof ProxyQuery);
\assert($query instanceof DatagridProxyInterface);

// Filter on blocks without page and parents
$rootAlias = current($query->getRootAliases());
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/PageAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public static function getSubscribedServices(): array
}

/**
* @param ProxyQueryInterface<object> $query
*
* @throws AccessDeniedException
*/
public function batchActionSnapshot(ProxyQueryInterface $query): RedirectResponse
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/SnapshotAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public static function getSubscribedServices(): array
}

/**
* @param ProxyQueryInterface<object> $query
*
* @throws AccessDeniedException
*/
public function batchActionToggleEnabled(ProxyQueryInterface $query): RedirectResponse
Expand Down
1 change: 1 addition & 0 deletions tests/Page/TemplateManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public function testTemplateShowingBreadcrumbIntoThePage(): void
$container->set('sonata.page.cms.snapshot', $cmsSnapshotManagerMock);

$twig = $container->get('twig');
\assert($twig instanceof Environment);

$manager = new TemplateManager($twig, []);
$response = $manager->renderResponse('test');
Expand Down

0 comments on commit 4631a51

Please sign in to comment.