diff --git a/src/Kunstmaan/AdminBundle/AdminList/ExceptionAdminListConfigurator.php b/src/Kunstmaan/AdminBundle/AdminList/ExceptionAdminListConfigurator.php index 183d2290d9..5e5bc78c78 100644 --- a/src/Kunstmaan/AdminBundle/AdminList/ExceptionAdminListConfigurator.php +++ b/src/Kunstmaan/AdminBundle/AdminList/ExceptionAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Entity\Exception; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; @@ -13,7 +13,7 @@ class ExceptionAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator { - public function __construct(EntityManager $em, AclHelper $aclHelper = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null) { parent::__construct($em, $aclHelper); } diff --git a/src/Kunstmaan/AdminBundle/Controller/DefaultController.php b/src/Kunstmaan/AdminBundle/Controller/DefaultController.php index 09a3e3fc8e..3f85c402d3 100644 --- a/src/Kunstmaan/AdminBundle/Controller/DefaultController.php +++ b/src/Kunstmaan/AdminBundle/Controller/DefaultController.php @@ -2,7 +2,6 @@ namespace Kunstmaan\AdminBundle\Controller; -use Doctrine\ORM\EntityManager; use Doctrine\Persistence\ManagerRegistry; use Kunstmaan\AdminBundle\Entity\DashboardConfiguration; use Kunstmaan\AdminBundle\FlashMessages\FlashTypes; @@ -59,7 +58,6 @@ public function indexAction(): Response #[Route(path: '/adminindex', name: 'KunstmaanAdminBundle_homepage_admin')] public function editIndexAction(Request $request): Response { - /* @var $em EntityManager */ $em = $this->managerRegistry->getManager(); /* @var DashboardConfiguration $dashboardConfiguration */ diff --git a/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php b/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php index b5e058073b..1124662631 100644 --- a/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php +++ b/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Controller; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\AdminList\ExceptionAdminListConfigurator; use Kunstmaan\AdminBundle\Entity\Exception; use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController; @@ -62,7 +62,6 @@ public function toggleResolveAction(Request $request, Exception $model) return new RedirectResponse($this->generateUrl('kunstmaanadminbundle_admin_exception')); } - /* @var EntityManager $em */ $em = $this->getEntityManager(); $this->getAdminListConfigurator(); diff --git a/src/Kunstmaan/AdminBundle/Helper/CloneHelper.php b/src/Kunstmaan/AdminBundle/Helper/CloneHelper.php index 4364bb8c80..137b5acfa3 100644 --- a/src/Kunstmaan/AdminBundle/Helper/CloneHelper.php +++ b/src/Kunstmaan/AdminBundle/Helper/CloneHelper.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Event\DeepCloneAndSaveEvent; use Kunstmaan\AdminBundle\Event\Events; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -13,7 +13,7 @@ class CloneHelper { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -22,7 +22,7 @@ class CloneHelper */ private $eventDispatcher; - public function __construct(EntityManager $em, EventDispatcherInterface $eventDispatcher) + public function __construct(EntityManagerInterface $em, EventDispatcherInterface $eventDispatcher) { $this->em = $em; $this->eventDispatcher = $eventDispatcher; diff --git a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidget.php b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidget.php index 11954d4542..a7338bde69 100644 --- a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidget.php +++ b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidget.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormHelper; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; @@ -76,7 +76,7 @@ public function bindRequest(Request $request) { } - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { foreach ($this->data as $item) { $em->persist($item); diff --git a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php index d926654e4f..7f70bdfd46 100644 --- a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php +++ b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\TabInterface; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormView; @@ -21,9 +21,9 @@ public function buildForm(FormBuilderInterface $builder); public function bindRequest(Request $request); /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager */ - public function persist(EntityManager $em); + public function persist(EntityManagerInterface $em); /** * @return array diff --git a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/ListWidget.php b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/ListWidget.php index f59086329a..8df5023fd8 100644 --- a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/ListWidget.php +++ b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/ListWidget.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormView; use Symfony\Component\HttpFoundation\Request; @@ -49,9 +49,9 @@ public function bindRequest(Request $request) } /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterfacer $em The entity manager */ - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { foreach ($this->widgets as $widget) { $widget->persist($em); diff --git a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/Tab.php b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/Tab.php index f0d6e5a0ff..a62aaf63d1 100644 --- a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/Tab.php +++ b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/Tab.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormHelper; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Symfony\Component\Form\FormBuilderInterface; @@ -92,7 +92,7 @@ public function bindRequest(Request $request) $this->widget->bindRequest($request); } - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { $this->widget->persist($em); } diff --git a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/TabPane.php b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/TabPane.php index 8e3db4a739..434b532306 100644 --- a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/TabPane.php +++ b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/Tabs/TabPane.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\UtilitiesBundle\Helper\Slugifier; use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\Form\Form; @@ -93,9 +93,9 @@ public function bindRequest(Request $request) } /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager */ - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { foreach ($this->tabs as $tab) { $tab->persist($em); diff --git a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclHelper.php b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclHelper.php index 4b11218620..3d4466fbdd 100644 --- a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclHelper.php +++ b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclHelper.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\Security\Acl; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\QuoteStrategy; use Doctrine\ORM\Query; use Doctrine\ORM\Query\Parameter; @@ -47,11 +47,11 @@ class AclHelper private $permissionsEnabled; /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager * @param TokenStorageInterface $tokenStorage The security token storage * @param RoleHierarchyInterface $rh The role hierarchies */ - public function __construct(EntityManager $em, TokenStorageInterface $tokenStorage, RoleHierarchyInterface $rh, $permissionsEnabled = true) + public function __construct(EntityManagerInterface $em, TokenStorageInterface $tokenStorage, RoleHierarchyInterface $rh, $permissionsEnabled = true) { $this->em = $em; $this->tokenStorage = $tokenStorage; diff --git a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclNativeHelper.php b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclNativeHelper.php index d593650508..f422237977 100644 --- a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclNativeHelper.php +++ b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/AclNativeHelper.php @@ -3,7 +3,7 @@ namespace Kunstmaan\AdminBundle\Helper\Security\Acl; use Doctrine\DBAL\Query\QueryBuilder; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\MaskBuilder; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionDefinition; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; @@ -18,7 +18,7 @@ class AclNativeHelper { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -38,11 +38,11 @@ class AclNativeHelper private $permissionsEnabled; /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager * @param TokenStorageInterface $tokenStorage The security context * @param RoleHierarchyInterface $rh The role hierarchies */ - public function __construct(EntityManager $em, TokenStorageInterface $tokenStorage, RoleHierarchyInterface $rh, $permissionsEnabled = true) + public function __construct(EntityManagerInterface $em, TokenStorageInterface $tokenStorage, RoleHierarchyInterface $rh, $permissionsEnabled = true) { $this->em = $em; $this->tokenStorage = $tokenStorage; diff --git a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php index 802a698276..5af4e410ce 100644 --- a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php +++ b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Helper\Security\Acl\Permission; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\AdminBundle\Entity\AclChangeset; use Kunstmaan\AdminBundle\Entity\BaseUser; @@ -36,7 +36,7 @@ class PermissionAdmin protected $resource; /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; @@ -81,7 +81,7 @@ class PermissionAdmin protected $shellHelper; /** - * @param EntityManager $em The EntityManager + * @param EntityManagerInterface $em The EntityManager * @param TokenStorageInterface $tokenStorage The token storage * @param AclProviderInterface $aclProvider The ACL provider * @param ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy The object retrieval strategy @@ -90,7 +90,7 @@ class PermissionAdmin * @param KernelInterface $kernel The kernel */ public function __construct( - EntityManager $em, + EntityManagerInterface $em, TokenStorageInterface $tokenStorage, AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/FormWidgetTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/FormWidgetTest.php index 5c3f15e79e..965c53cb52 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/FormWidgetTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/FormWidgetTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Tests\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\User; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use PHPUnit\Framework\TestCase; @@ -16,7 +16,7 @@ class FormWidgetTest extends TestCase public function testWidget() { $builder = $this->createMock(FormBuilder::class); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $em->expects($this->once())->method('persist')->willReturn(new User()); $builder->expects($this->once())->method('getData'); $builder->expects($this->atLeastOnce())->method('add'); diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/ListWidgetTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/ListWidgetTest.php index 40865d00e4..89171600fb 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/ListWidgetTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/ListWidgetTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Tests\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\AdminBundle\Helper\FormWidgets\ListWidget; use PHPUnit\Framework\TestCase; @@ -19,7 +19,7 @@ public function testWidget() $widget = $this->createMock(FormWidget::class); $builder = $this->createMock(FormBuilder::class); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $widget->expects($this->exactly(2))->method('bindRequest')->willReturn(true); $widget->expects($this->exactly(2))->method('persist')->willReturn(true); diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/Tabs/TabTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/Tabs/TabTest.php index f6cd7e0586..183b5add33 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/Tabs/TabTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/FormWidgets/Tabs/TabTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\AdminBundle\Tests\Helper\FormWidgets\Tabs; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormHelper; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\Tab; @@ -18,7 +18,7 @@ class TabTest extends TestCase */ public function testTab() { - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $builder = $this->createMock(FormBuilder::class); $view = $this->createMock(FormView::class); $widget = $this->createMock(FormWidget::class); diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclHelperTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclHelperTest.php index 5b76afa989..8245110906 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclHelperTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclHelperTest.php @@ -5,7 +5,7 @@ use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Result; use Doctrine\ORM\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\QuoteStrategy; use Doctrine\ORM\NativeQuery; @@ -26,7 +26,7 @@ class AclHelperTest extends TestCase { /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclNativeHelperTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclNativeHelperTest.php index a424890c5c..cd09bce35c 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclNativeHelperTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclNativeHelperTest.php @@ -5,7 +5,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Query\QueryBuilder; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; use Kunstmaan\AdminBundle\Entity\User; use Kunstmaan\AdminBundle\Entity\UserInterface; @@ -21,7 +21,7 @@ class AclNativeHelperTest extends TestCase { /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclWalkerTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclWalkerTest.php index 77e85ce231..15c2ad34e0 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclWalkerTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/AclWalkerTest.php @@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\ORM\AbstractQuery; use Doctrine\ORM\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\QuoteStrategy; use Doctrine\ORM\Query; @@ -40,7 +40,7 @@ public function testWalker() $conn = $this->createMock(Connection::class); $conn->expects($this->any())->method('getDatabasePlatform')->willReturn($platform); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $query = $this->createMock(AbstractQuery::class); $mapping = $this->createMock(ResultSetMapping::class); $result = $this->createMock(ParserResult::class); diff --git a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/Permission/PermissionAdminTest.php b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/Permission/PermissionAdminTest.php index bd1c801b10..14a4ee0b2b 100644 --- a/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/Permission/PermissionAdminTest.php +++ b/src/Kunstmaan/AdminBundle/Tests/Helper/Security/Acl/Permission/PermissionAdminTest.php @@ -3,7 +3,7 @@ namespace Kunstmaan\AdminBundle\Tests\Helper\Security\Acl\Permission; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\AdminBundle\Entity\Role; @@ -143,7 +143,7 @@ public function testCreateAclChangeset() /** * Return entity manager mock */ - public function getEntityManager(): EntityManager + public function getEntityManager(): EntityManagerInterface { return $this->getMockBuilder('Doctrine\ORM\EntityManager') ->disableOriginalConstructor() diff --git a/src/Kunstmaan/AdminListBundle/Controller/AbstractAdminListController.php b/src/Kunstmaan/AdminListBundle/Controller/AbstractAdminListController.php index cc0e47c3dd..ad6dd11e4e 100644 --- a/src/Kunstmaan/AdminListBundle/Controller/AbstractAdminListController.php +++ b/src/Kunstmaan/AdminListBundle/Controller/AbstractAdminListController.php @@ -2,7 +2,6 @@ namespace Kunstmaan\AdminListBundle\Controller; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ManagerRegistry; use Kunstmaan\AdminBundle\Entity\EntityInterface; @@ -102,7 +101,6 @@ protected function doAddAction(AdminListConfiguratorInterface $configurator, $ty throw $this->createAccessDeniedException('You do not have sufficient rights to access this page.'); } - /* @var EntityManager $em */ $em = $this->getEntityManager(); $entityName = $type ?? $configurator->getRepositoryName(); @@ -192,7 +190,6 @@ protected function doAddAction(AdminListConfiguratorInterface $configurator, $ty */ protected function doEditAction(AdminListConfiguratorInterface $configurator, $entityId, Request $request) { - /* @var EntityManager $em */ $em = $this->getEntityManager(); $helper = $em->getRepository($configurator->getRepositoryName())->findOneById($entityId); @@ -306,7 +303,6 @@ protected function doEditAction(AdminListConfiguratorInterface $configurator, $e protected function doViewAction(AdminListConfiguratorInterface $configurator, $entityId, Request $request) { - /* @var EntityManager $em */ $em = $this->getEntityManager(); $helper = $em->getRepository($configurator->getRepositoryName())->findOneById($entityId); if ($helper === null) { @@ -351,7 +347,6 @@ protected function doDeleteAction(AdminListConfiguratorInterface $configurator, return new RedirectResponse($this->generateUrl($indexUrl['path'], $indexUrl['params'] ?? [])); } - /* @var $em EntityManager */ $em = $this->getEntityManager(); $helper = $em->getRepository($configurator->getRepositoryName())->findOneById($entityId); if ($helper === null) { diff --git a/src/Kunstmaan/ArticleBundle/Controller/AbstractArticleEntityAdminListController.php b/src/Kunstmaan/ArticleBundle/Controller/AbstractArticleEntityAdminListController.php index 0f853ed445..a148dbcfb5 100644 --- a/src/Kunstmaan/ArticleBundle/Controller/AbstractArticleEntityAdminListController.php +++ b/src/Kunstmaan/ArticleBundle/Controller/AbstractArticleEntityAdminListController.php @@ -2,7 +2,7 @@ namespace Kunstmaan\ArticleBundle\Controller; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\BaseUser; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface; @@ -18,7 +18,7 @@ abstract class AbstractArticleEntityAdminListController extends AbstractAdminLis protected $configurator; /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; diff --git a/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticleAuthorAdminListConfiguratorTest.php b/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticleAuthorAdminListConfiguratorTest.php index 198a84181b..d367a37816 100644 --- a/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticleAuthorAdminListConfiguratorTest.php +++ b/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticleAuthorAdminListConfiguratorTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\ArticleBundle\Tests\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\ArticleBundle\AdminList\AbstractArticleAuthorAdminListConfigurator; use PHPUnit\Framework\TestCase; @@ -16,7 +16,7 @@ class AbstractArticleAuthorAdminListConfiguratorTest extends TestCase protected function setUp(): void { - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $em->expects($this->any()) ->method($this->anything()) ->willReturn($em); diff --git a/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticlePageAdminListConfiguratorTest.php b/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticlePageAdminListConfiguratorTest.php index 8ac5c43026..49f325bdda 100644 --- a/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticlePageAdminListConfiguratorTest.php +++ b/src/Kunstmaan/ArticleBundle/Tests/AdminList/AbstractArticlePageAdminListConfiguratorTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\ArticleBundle\Tests\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; @@ -18,7 +18,7 @@ class Configurator extends AbstractArticlePageAdminListConfigurator /** @var EntityRepository */ private $repo; - public function __construct(EntityManager $em, AclHelper $aclHelper, $locale, $permission, $repo) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper, $locale, $permission, $repo) { parent::__construct($em, $aclHelper, $locale, $permission); $this->repo = $repo; @@ -41,13 +41,13 @@ class AbstractArticlePageAdminListConfiguratorTest extends TestCase protected $object; /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; protected function setUp(): void { - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $em->expects($this->any()) ->method($this->anything()) ->willReturn($em); @@ -61,7 +61,7 @@ protected function setUp(): void $this->em = $em; - /* @var EntityManager $em */ + /* @var EntityManagerInterface $em */ /* @var AclHelper $acl */ $this->object = new Configurator($em, $acl, 'nl', 'admin', $repo); } @@ -115,7 +115,7 @@ public function testGetUrls() */ public function testGetQueryBuilder() { - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $qb = $this->createMock(QueryBuilder::class); $em->expects($this->any()) ->method('createQueryBuilder') @@ -147,7 +147,7 @@ public function testGetQueryBuilder() */ public function testEntityClassName() { - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $repo = $this->createMock(EntityRepository::class); $em->expects($this->any()) diff --git a/src/Kunstmaan/ArticleBundle/Tests/Repository/AbstractArticleOverviewPageRepositoryTest.php b/src/Kunstmaan/ArticleBundle/Tests/Repository/AbstractArticleOverviewPageRepositoryTest.php index 92524c4964..f72296eaf6 100644 --- a/src/Kunstmaan/ArticleBundle/Tests/Repository/AbstractArticleOverviewPageRepositoryTest.php +++ b/src/Kunstmaan/ArticleBundle/Tests/Repository/AbstractArticleOverviewPageRepositoryTest.php @@ -3,7 +3,7 @@ namespace Kunstmaan\ArticleBundle\Tests\Repository; use Doctrine\ORM\AbstractQuery; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\QueryBuilder; use Kunstmaan\ArticleBundle\Repository\AbstractArticleOverviewPageRepository; @@ -30,7 +30,7 @@ public function testFindActiveOverviewPages() $qb->expects($this->exactly(2))->method('setParameter')->willReturn($qb); $qb->expects($this->once())->method('getQuery')->willReturn($query); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $em->expects($this->once())->method('createQueryBuilder')->willReturn($qb); $entity = new Repo($em, new ClassMetadata(Article::class)); diff --git a/src/Kunstmaan/CookieBundle/AdminList/CookieAdminListConfigurator.php b/src/Kunstmaan/CookieBundle/AdminList/CookieAdminListConfigurator.php index 5ab2f6c31b..1c6f931c17 100644 --- a/src/Kunstmaan/CookieBundle/AdminList/CookieAdminListConfigurator.php +++ b/src/Kunstmaan/CookieBundle/AdminList/CookieAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\CookieBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; @@ -24,7 +24,7 @@ class CookieAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurat */ private $domainConfiguration; - public function __construct(EntityManager $em, AclHelper $aclHelper = null, DomainConfigurationInterface $domainConfiguration = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null, DomainConfigurationInterface $domainConfiguration = null) { parent::__construct($em, $aclHelper); diff --git a/src/Kunstmaan/CookieBundle/AdminList/CookieTypeAdminListConfigurator.php b/src/Kunstmaan/CookieBundle/AdminList/CookieTypeAdminListConfigurator.php index ddf10e5398..9c5ada4021 100644 --- a/src/Kunstmaan/CookieBundle/AdminList/CookieTypeAdminListConfigurator.php +++ b/src/Kunstmaan/CookieBundle/AdminList/CookieTypeAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\CookieBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM; @@ -15,10 +15,10 @@ class CookieTypeAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator implements SortableInterface { /** - * @param EntityManager $em The entity manager - * @param AclHelper $aclHelper The acl helper + * @param EntityManagerInterface $em The entity manager + * @param AclHelper $aclHelper The acl helper */ - public function __construct(EntityManager $em, AclHelper $aclHelper = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null) { parent::__construct($em, $aclHelper); $this->setAdminType(CookieTypeAdminType::class); diff --git a/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php b/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php index 21e5dc08ba..c214219f66 100644 --- a/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php +++ b/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php @@ -2,7 +2,7 @@ namespace Kunstmaan\DashboardBundle\Command\Helper\Analytics; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\DashboardBundle\Entity\AnalyticsOverview; use Kunstmaan\DashboardBundle\Helper\Google\Analytics\ConfigHelper; use Kunstmaan\DashboardBundle\Helper\Google\Analytics\QueryHelper; @@ -16,7 +16,7 @@ abstract class AbstractAnalyticsCommandHelper /** @var QueryHelper */ protected $query; - /** @var EntityManager */ + /** @var EntityManagerInterface */ protected $em; /** @var OutputInterface */ diff --git a/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php b/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php index 7012673483..9d98e4d228 100644 --- a/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php +++ b/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php @@ -2,7 +2,7 @@ namespace Kunstmaan\DashboardBundle\Helper\Google\Analytics; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\DashboardBundle\Entity\AnalyticsConfig; use Kunstmaan\DashboardBundle\Repository\AnalyticsConfigRepository; @@ -23,10 +23,10 @@ class ConfigHelper /** @var string */ private $profileId = false; - /** @var EntityManager */ + /** @var EntityManagerInterface */ private $em; - public function __construct(ServiceHelper $serviceHelper, EntityManager $em) + public function __construct(ServiceHelper $serviceHelper, EntityManagerInterface $em) { $this->serviceHelper = $serviceHelper; $this->em = $em; diff --git a/src/Kunstmaan/FixturesBundle/Builder/MediaBuilder.php b/src/Kunstmaan/FixturesBundle/Builder/MediaBuilder.php index c7091889a1..7b88fb9f55 100644 --- a/src/Kunstmaan/FixturesBundle/Builder/MediaBuilder.php +++ b/src/Kunstmaan/FixturesBundle/Builder/MediaBuilder.php @@ -2,7 +2,6 @@ namespace Kunstmaan\FixturesBundle\Builder; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\FixturesBundle\Loader\Fixture; use Kunstmaan\MediaBundle\Entity\Folder; @@ -24,7 +23,7 @@ class MediaBuilder implements BuilderInterface private $folder; - public function __construct(EntityManager $em, FileHandler $fileHandler, MimeTypes $mimeTypes) + public function __construct(EntityManagerInterface $em, FileHandler $fileHandler, MimeTypes $mimeTypes) { $this->em = $em; $this->fileHandler = $fileHandler; diff --git a/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php b/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php index bd640b5996..3dc4a684b8 100644 --- a/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php +++ b/src/Kunstmaan/FixturesBundle/Builder/PageBuilder.php @@ -2,7 +2,7 @@ namespace Kunstmaan\FixturesBundle\Builder; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\FixturesBundle\Loader\Fixture; use Kunstmaan\FixturesBundle\Populator\Populator; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; @@ -38,7 +38,7 @@ class PageBuilder implements BuilderInterface private $pagesConfiguration; public function __construct( - EntityManager $em, + EntityManagerInterface $em, ACLPermissionCreatorService $aclPermissionCreatorService, Populator $populator, Slugifier $slugifier, diff --git a/src/Kunstmaan/FixturesBundle/Builder/PagePartBuilder.php b/src/Kunstmaan/FixturesBundle/Builder/PagePartBuilder.php index 292e2700e6..beb2403499 100644 --- a/src/Kunstmaan/FixturesBundle/Builder/PagePartBuilder.php +++ b/src/Kunstmaan/FixturesBundle/Builder/PagePartBuilder.php @@ -2,7 +2,7 @@ namespace Kunstmaan\FixturesBundle\Builder; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\FixturesBundle\Loader\Fixture; use Kunstmaan\FixturesBundle\Populator\Populator; use Kunstmaan\PagePartBundle\Entity\PagePartRef; @@ -10,7 +10,7 @@ class PagePartBuilder implements BuilderInterface { - /** @var \Doctrine\ORM\EntityManager */ + /** @var EntityManagerInterface */ private $em; /** @var \Kunstmaan\PagePartBundle\Repository\PagePartRefRepository */ @@ -19,7 +19,7 @@ class PagePartBuilder implements BuilderInterface /** @var \Kunstmaan\FixturesBundle\Populator\Populator */ private $populator; - public function __construct(EntityManager $em, Populator $populator) + public function __construct(EntityManagerInterface $em, Populator $populator) { $this->em = $em; $this->pagePartRepo = $em->getRepository(PagePartRef::class); diff --git a/src/Kunstmaan/FixturesBundle/Provider/NodeTranslation.php b/src/Kunstmaan/FixturesBundle/Provider/NodeTranslation.php index 3f82a0a314..87a4122db8 100644 --- a/src/Kunstmaan/FixturesBundle/Provider/NodeTranslation.php +++ b/src/Kunstmaan/FixturesBundle/Provider/NodeTranslation.php @@ -2,14 +2,14 @@ namespace Kunstmaan\FixturesBundle\Provider; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\NodeBundle\Entity\NodeTranslation as NodeBundleNodeTranslation; class NodeTranslation { private $nodeTransRepo; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->nodeTransRepo = $em->getRepository(NodeBundleNodeTranslation::class); } diff --git a/src/Kunstmaan/FormBundle/AdminList/FormPageAdminListConfigurator.php b/src/Kunstmaan/FormBundle/AdminList/FormPageAdminListConfigurator.php index efc1f7c225..2c956388ab 100644 --- a/src/Kunstmaan/FormBundle/AdminList/FormPageAdminListConfigurator.php +++ b/src/Kunstmaan/FormBundle/AdminList/FormPageAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\FormBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Entity\EntityInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; @@ -22,7 +22,7 @@ class FormPageAdminListConfigurator extends AbstractDoctrineORMAdminListConfigur protected $permission; /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager * @param AclHelper $aclHelper The ACL helper * @param string $permission The permission */ diff --git a/src/Kunstmaan/FormBundle/AdminList/FormSubmissionAdminListConfigurator.php b/src/Kunstmaan/FormBundle/AdminList/FormSubmissionAdminListConfigurator.php index 6ef5f91c79..23c5ada675 100644 --- a/src/Kunstmaan/FormBundle/AdminList/FormSubmissionAdminListConfigurator.php +++ b/src/Kunstmaan/FormBundle/AdminList/FormSubmissionAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\FormBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Entity\EntityInterface; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; @@ -26,11 +26,11 @@ class FormSubmissionAdminListConfigurator extends AbstractDoctrineORMAdminListCo protected $deletableFormsubmissions; /** - * @param EntityManager $em The entity manager - * @param NodeTranslation $nodeTranslation The node translation - * @param bool $deletableFormsubmissions Can formsubmissions be deleted or not + * @param EntityManagerInterface $em The entity manager + * @param NodeTranslation $nodeTranslation The node translation + * @param bool $deletableFormsubmissions Can formsubmissions be deleted or not */ - public function __construct(EntityManager $em, $nodeTranslation, $deletableFormsubmissions = false) + public function __construct(EntityManagerInterface $em, $nodeTranslation, $deletableFormsubmissions = false) { parent::__construct($em); $this->nodeTranslation = $nodeTranslation; diff --git a/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php b/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php index 2f162d8819..6be0eb3fdd 100644 --- a/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php +++ b/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php @@ -2,7 +2,7 @@ namespace Kunstmaan\FormBundle\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\FormBundle\Entity\AbstractFormPage; use Kunstmaan\NodeBundle\Event\ConfigureActionMenuEvent; use Symfony\Component\Routing\Router; @@ -14,7 +14,7 @@ class ConfigureActionsMenuListener { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -24,10 +24,10 @@ class ConfigureActionsMenuListener private $router; /** - * @param EntityManager $em The entity manager - * @param RouterInterface $router The router + * @param EntityManagerInterface $em The entity manager + * @param RouterInterface $router The router */ - public function __construct(EntityManager $em, RouterInterface $router) + public function __construct(EntityManagerInterface $em, RouterInterface $router) { $this->router = $router; $this->em = $em; diff --git a/src/Kunstmaan/FormBundle/Tests/AdminList/FormPageAdminListConfiguratorTest.php b/src/Kunstmaan/FormBundle/Tests/AdminList/FormPageAdminListConfiguratorTest.php index f2e3747a6d..9483ba8482 100644 --- a/src/Kunstmaan/FormBundle/Tests/AdminList/FormPageAdminListConfiguratorTest.php +++ b/src/Kunstmaan/FormBundle/Tests/AdminList/FormPageAdminListConfiguratorTest.php @@ -3,7 +3,7 @@ namespace Kunstmaan\FormBundle\Tests\AdminList; use Doctrine\ORM\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminListBundle\AdminList\ItemAction\SimpleItemAction; @@ -29,7 +29,7 @@ protected function setUp(): void } /** - * @return \Doctrine\ORM\EntityManager + * @return EntityManagerInterface */ protected function getMockedEntityManager() { @@ -41,7 +41,7 @@ protected function getMockedEntityManager() $repository->method('findBy')->willReturn(null); $repository->method('findOneBy')->willReturn(null); - $emMock = $this->createMock(EntityManager::class); + $emMock = $this->createMock(EntityManagerInterface::class); $emMock->method('getRepository')->willReturn($repository); $emMock->method('getClassMetaData')->willReturn((object) ['name' => 'aClass']); $emMock->method('getConfiguration')->willReturn($configuration); diff --git a/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionAdminListConfiguratorTest.php b/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionAdminListConfiguratorTest.php index 60bf551bbc..15bd229777 100644 --- a/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionAdminListConfiguratorTest.php +++ b/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionAdminListConfiguratorTest.php @@ -3,7 +3,7 @@ namespace Kunstmaan\FormBundle\Tests\AdminList; use Doctrine\ORM\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminListBundle\AdminList\ItemAction\SimpleItemAction; @@ -31,7 +31,7 @@ protected function setUp(): void } /** - * @return \Doctrine\ORM\EntityManager + * @return EntityManagerInterface */ protected function getMockedEntityManager() { @@ -43,7 +43,7 @@ protected function getMockedEntityManager() $repository->method('findBy')->willReturn(null); $repository->method('findOneBy')->willReturn(null); - $emMock = $this->createMock(EntityManager::class); + $emMock = $this->createMock(EntityManagerInterface::class); $emMock->method('getRepository')->willReturn($repository); $emMock->method('getClassMetaData')->willReturn((object) ['name' => 'aClass']); $emMock->method('getConfiguration')->willReturn($configuration); diff --git a/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionExportListConfiguratorTest.php b/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionExportListConfiguratorTest.php index 95de9014f5..6759b72c0b 100644 --- a/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionExportListConfiguratorTest.php +++ b/src/Kunstmaan/FormBundle/Tests/AdminList/FormSubmissionExportListConfiguratorTest.php @@ -4,7 +4,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\FormBundle\AdminList\FormSubmissionExportListConfigurator; use Kunstmaan\FormBundle\Entity\FormSubmission; @@ -41,7 +41,7 @@ protected function setUp(): void } /** - * @return \Doctrine\ORM\EntityManager + * @return EntityManagerInterface */ protected function getMockedEntityManager() { @@ -92,7 +92,7 @@ protected function getMockedEntityManager() $repository->method('findBy')->willReturn(null); $repository->method('findOneBy')->willReturn(null); - $emMock = $this->createMock(EntityManager::class); + $emMock = $this->createMock(EntityManagerInterface::class); $emMock->method('getRepository')->willReturn($repository); $emMock->method('getClassMetaData')->willReturn((object) ['name' => 'aClass']); $emMock->method('getConfiguration')->willReturn($configuration); diff --git a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/adminlist/AdminList/AdminListConfigurator.php b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/adminlist/AdminList/AdminListConfigurator.php index ea7c7a5fa1..c60c7a1857 100755 --- a/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/adminlist/AdminList/AdminListConfigurator.php +++ b/src/Kunstmaan/GeneratorBundle/Resources/SensioGeneratorBundle/skeleton/adminlist/AdminList/AdminListConfigurator.php @@ -2,7 +2,7 @@ namespace {{ namespace }}\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use {{ namespace }}\Form\{{ entity_class }}AdminType; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; @@ -14,7 +14,7 @@ class {{ entity_class }}AdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator{% if sortField %} implements SortableInterface {% endif %} { - public function __construct(EntityManager $em, AclHelper $aclHelper = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null) { parent::__construct($em, $aclHelper); {% if generate_admin_type %} diff --git a/src/Kunstmaan/LeadGenerationBundle/AdminList/PopupAdminListConfigurator.php b/src/Kunstmaan/LeadGenerationBundle/AdminList/PopupAdminListConfigurator.php index 0832fe4da0..fb70df7bd7 100644 --- a/src/Kunstmaan/LeadGenerationBundle/AdminList/PopupAdminListConfigurator.php +++ b/src/Kunstmaan/LeadGenerationBundle/AdminList/PopupAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\LeadGenerationBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM; @@ -10,10 +10,10 @@ class PopupAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator { /** - * @param EntityManager $em The entity manager - * @param AclHelper $aclHelper The acl helper + * @param EntityManagerInterface $em The entity manager + * @param AclHelper $aclHelper The acl helper */ - public function __construct(EntityManager $em, AclHelper $aclHelper = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null) { parent::__construct($em, $aclHelper); diff --git a/src/Kunstmaan/LeadGenerationBundle/AdminList/RulesAdminListConfigurator.php b/src/Kunstmaan/LeadGenerationBundle/AdminList/RulesAdminListConfigurator.php index 9785c85f79..1940887811 100644 --- a/src/Kunstmaan/LeadGenerationBundle/AdminList/RulesAdminListConfigurator.php +++ b/src/Kunstmaan/LeadGenerationBundle/AdminList/RulesAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\LeadGenerationBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; @@ -19,7 +19,7 @@ class RulesAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurato /** * @param int $id The if of the popup */ - public function __construct(EntityManager $em, ?AclHelper $aclHelper, $id) + public function __construct(EntityManagerInterface $em, ?AclHelper $aclHelper, $id) { parent::__construct($em, $aclHelper); diff --git a/src/Kunstmaan/LeadGenerationBundle/Service/PopupManager.php b/src/Kunstmaan/LeadGenerationBundle/Service/PopupManager.php index 81302d4894..98509510dc 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Service/PopupManager.php +++ b/src/Kunstmaan/LeadGenerationBundle/Service/PopupManager.php @@ -2,7 +2,7 @@ namespace Kunstmaan\LeadGenerationBundle\Service; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\LeadGenerationBundle\Entity\Popup\AbstractPopup; use Kunstmaan\LeadGenerationBundle\Entity\Rule\AfterXScrollPercentRule; use Kunstmaan\LeadGenerationBundle\Entity\Rule\AfterXSecondsRule; @@ -20,11 +20,11 @@ class PopupManager private $popups; /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/MediaBundle/AdminList/MediaAdminListConfigurator.php b/src/Kunstmaan/MediaBundle/AdminList/MediaAdminListConfigurator.php index 215d77afa9..4063d7f0e8 100644 --- a/src/Kunstmaan/MediaBundle/AdminList/MediaAdminListConfigurator.php +++ b/src/Kunstmaan/MediaBundle/AdminList/MediaAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\MediaBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; use Kunstmaan\AdminListBundle\AdminList\Configurator\ChangeableLimitInterface; @@ -37,13 +37,13 @@ class MediaAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurato private $request; /** - * @param EntityManager $em The entity manager - * @param MediaManager $mediaManager The media manager - * @param Folder $folder The current folder - * @param Request $request The request object + * @param EntityManagerInterface $em The entity manager + * @param MediaManager $mediaManager The media manager + * @param Folder $folder The current folder + * @param Request $request The request object */ public function __construct( - EntityManager $em, + EntityManagerInterface $em, MediaManager $mediaManager, Folder $folder, Request $request diff --git a/src/Kunstmaan/MediaBundle/Command/CleanDeletedMediaCommand.php b/src/Kunstmaan/MediaBundle/Command/CleanDeletedMediaCommand.php index 6e479a35bb..45fe55deba 100644 --- a/src/Kunstmaan/MediaBundle/Command/CleanDeletedMediaCommand.php +++ b/src/Kunstmaan/MediaBundle/Command/CleanDeletedMediaCommand.php @@ -2,7 +2,6 @@ namespace Kunstmaan\MediaBundle\Command; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\MediaBundle\Entity\Media; use Kunstmaan\MediaBundle\Helper\MediaManager; @@ -17,7 +16,7 @@ final class CleanDeletedMediaCommand extends Command { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/MediaBundle/Command/CreatePdfPreviewCommand.php b/src/Kunstmaan/MediaBundle/Command/CreatePdfPreviewCommand.php index 8fe03f7228..83ddda76c7 100644 --- a/src/Kunstmaan/MediaBundle/Command/CreatePdfPreviewCommand.php +++ b/src/Kunstmaan/MediaBundle/Command/CreatePdfPreviewCommand.php @@ -2,7 +2,6 @@ namespace Kunstmaan\MediaBundle\Command; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\MediaBundle\Entity\Media; use Kunstmaan\MediaBundle\Helper\Transformer\PdfTransformer; @@ -15,7 +14,7 @@ final class CreatePdfPreviewCommand extends Command { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/MediaBundle/Command/RebuildFolderTreeCommand.php b/src/Kunstmaan/MediaBundle/Command/RebuildFolderTreeCommand.php index e0b0c3f577..20fd85fe10 100644 --- a/src/Kunstmaan/MediaBundle/Command/RebuildFolderTreeCommand.php +++ b/src/Kunstmaan/MediaBundle/Command/RebuildFolderTreeCommand.php @@ -2,7 +2,6 @@ namespace Kunstmaan\MediaBundle\Command; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\MediaBundle\Entity\Folder; use Symfony\Component\Console\Attribute\AsCommand; @@ -14,7 +13,7 @@ final class RebuildFolderTreeCommand extends Command { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php b/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php index ab6be5e481..5c323b0e97 100644 --- a/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php +++ b/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php @@ -2,7 +2,6 @@ namespace Kunstmaan\MediaBundle\Command; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\MediaBundle\Entity\Media; use Kunstmaan\MediaBundle\Helper\File\FileHandler; @@ -16,7 +15,7 @@ #[AsCommand(name: 'kuma:media:rename-soft-deleted', description: 'Rename physical files for soft-deleted media.')] final class RenameSoftDeletedCommand extends Command { - /** @var EntityManager */ + /** @var EntityManagerInterface */ protected $em; /** diff --git a/src/Kunstmaan/MediaBundle/Helper/Services/MediaCreatorService.php b/src/Kunstmaan/MediaBundle/Helper/Services/MediaCreatorService.php index afc4ad7666..9d1a60ccb3 100644 --- a/src/Kunstmaan/MediaBundle/Helper/Services/MediaCreatorService.php +++ b/src/Kunstmaan/MediaBundle/Helper/Services/MediaCreatorService.php @@ -2,7 +2,7 @@ namespace Kunstmaan\MediaBundle\Helper\Services; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\MediaBundle\Entity\Folder; use Kunstmaan\MediaBundle\Entity\Media; use Kunstmaan\MediaBundle\Repository\FolderRepository; @@ -21,7 +21,7 @@ class MediaCreatorService protected $container; /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; diff --git a/src/Kunstmaan/MenuBundle/AdminList/MenuAdminListConfigurator.php b/src/Kunstmaan/MenuBundle/AdminList/MenuAdminListConfigurator.php index d63647f8b2..dd80e864e1 100644 --- a/src/Kunstmaan/MenuBundle/AdminList/MenuAdminListConfigurator.php +++ b/src/Kunstmaan/MenuBundle/AdminList/MenuAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\MenuBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; @@ -16,10 +16,10 @@ class MenuAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator private $locale; /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager * @param AclHelper $aclHelper The acl helper */ - public function __construct(EntityManager $em, AclHelper $aclHelper = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null) { parent::__construct($em, $aclHelper); } diff --git a/src/Kunstmaan/MenuBundle/AdminList/MenuItemAdminListConfigurator.php b/src/Kunstmaan/MenuBundle/AdminList/MenuItemAdminListConfigurator.php index 54f287dcb1..ac06fcbd18 100644 --- a/src/Kunstmaan/MenuBundle/AdminList/MenuItemAdminListConfigurator.php +++ b/src/Kunstmaan/MenuBundle/AdminList/MenuItemAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\MenuBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; @@ -16,7 +16,7 @@ class MenuItemAdminListConfigurator extends AbstractDoctrineORMAdminListConfigur */ private $menu; - public function __construct(EntityManager $em, ?AclHelper $aclHelper, Menu $menu) + public function __construct(EntityManagerInterface $em, ?AclHelper $aclHelper, Menu $menu) { parent::__construct($em, $aclHelper); diff --git a/src/Kunstmaan/MenuBundle/Service/MenuService.php b/src/Kunstmaan/MenuBundle/Service/MenuService.php index a38db32e06..d1bcc973ef 100644 --- a/src/Kunstmaan/MenuBundle/Service/MenuService.php +++ b/src/Kunstmaan/MenuBundle/Service/MenuService.php @@ -2,7 +2,7 @@ namespace Kunstmaan\MenuBundle\Service; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; class MenuService @@ -18,7 +18,7 @@ class MenuService private $domainConfiguration; /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -27,7 +27,7 @@ class MenuService */ private $menuEntityClass; - public function __construct(array $menuNames, DomainConfigurationInterface $domainConfiguration, EntityManager $em, $menuEntityClass) + public function __construct(array $menuNames, DomainConfigurationInterface $domainConfiguration, EntityManagerInterface $em, $menuEntityClass) { $this->menuNames = $menuNames; $this->domainConfiguration = $domainConfiguration; diff --git a/src/Kunstmaan/NodeBundle/AdminList/NodeAdminListConfigurator.php b/src/Kunstmaan/NodeBundle/AdminList/NodeAdminListConfigurator.php index d325bddca9..c8cbea2523 100644 --- a/src/Kunstmaan/NodeBundle/AdminList/NodeAdminListConfigurator.php +++ b/src/Kunstmaan/NodeBundle/AdminList/NodeAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; @@ -47,14 +47,12 @@ class NodeAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator protected $authorizationChecker; /** - * @param EntityManager $em The entity - * manager - * @param AclHelper $aclHelper The ACL helper - * @param string $locale The current - * locale - * @param string $permission The permission + * @param EntityManagerInterface $em The entity manager + * @param AclHelper $aclHelper The ACL helper + * @param string $locale The current locale + * @param string $permission The permission */ - public function __construct(EntityManager $em, AclHelper $aclHelper, $locale, $permission, AuthorizationCheckerInterface $authorizationChecker) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper, $locale, $permission, AuthorizationCheckerInterface $authorizationChecker) { parent::__construct($em, $aclHelper); $this->locale = $locale; diff --git a/src/Kunstmaan/NodeBundle/Command/CronUpdateNodeCommand.php b/src/Kunstmaan/NodeBundle/Command/CronUpdateNodeCommand.php index 62f9a734fb..c83db55a61 100644 --- a/src/Kunstmaan/NodeBundle/Command/CronUpdateNodeCommand.php +++ b/src/Kunstmaan/NodeBundle/Command/CronUpdateNodeCommand.php @@ -2,7 +2,6 @@ namespace Kunstmaan\NodeBundle\Command; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\NodeBundle\Entity\QueuedNodeTranslationAction; use Kunstmaan\NodeBundle\Helper\NodeAdmin\NodeAdminPublisher; @@ -17,7 +16,7 @@ final class CronUpdateNodeCommand extends Command { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/NodeBundle/Command/InitAclCommand.php b/src/Kunstmaan/NodeBundle/Command/InitAclCommand.php index 2ac47c3d8c..7f381f3bb8 100644 --- a/src/Kunstmaan/NodeBundle/Command/InitAclCommand.php +++ b/src/Kunstmaan/NodeBundle/Command/InitAclCommand.php @@ -2,7 +2,6 @@ namespace Kunstmaan\NodeBundle\Command; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\MaskBuilder; use Kunstmaan\NodeBundle\Entity\Node; @@ -23,7 +22,7 @@ final class InitAclCommand extends Command { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php b/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php index 640b24f26e..3f5d12c165 100644 --- a/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php +++ b/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php @@ -3,7 +3,6 @@ namespace Kunstmaan\NodeBundle\Controller; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Kunstmaan\AdminBundle\Entity\BaseUser; @@ -56,7 +55,7 @@ final class NodeAdminController extends AbstractController { /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; @@ -1029,13 +1028,13 @@ private function checkPermission(Node $node, $permission) } /** - * @param EntityManager $em The Entity Manager - * @param BaseUser $user The user who deletes the children - * @param string $locale The locale that was used - * @param ArrayCollection $children The children array + * @param EntityManagerInterface $em The Entity Manager + * @param BaseUser $user The user who deletes the children + * @param string $locale The locale that was used + * @param ArrayCollection $children The children array */ private function deleteNodeChildren( - EntityManager $em, + EntityManagerInterface $em, BaseUser $user, $locale, ArrayCollection $children diff --git a/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php b/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php index a60974a718..b7de96a35d 100644 --- a/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php +++ b/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php @@ -3,7 +3,7 @@ namespace Kunstmaan\NodeBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping as ORM; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\NodeBundle\Form\NodeTranslationAdminType; @@ -388,12 +388,12 @@ public function getDefaultAdminType() } /** - * @param EntityManager $em The entity manager - * @param string $type The type + * @param EntityManagerInterface $em The entity manager + * @param string $type The type * * @return object|null */ - public function getRef(EntityManager $em, $type = 'public') + public function getRef(EntityManagerInterface $em, $type = 'public') { $nodeVersion = $this->getNodeVersion($type); if ($nodeVersion) { diff --git a/src/Kunstmaan/NodeBundle/EventListener/SlugSecurityListener.php b/src/Kunstmaan/NodeBundle/EventListener/SlugSecurityListener.php index 569a885832..87aadaf0f6 100644 --- a/src/Kunstmaan/NodeBundle/EventListener/SlugSecurityListener.php +++ b/src/Kunstmaan/NodeBundle/EventListener/SlugSecurityListener.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMap; use Kunstmaan\NodeBundle\Event\SlugSecurityEvent; use Kunstmaan\NodeBundle\Helper\NodeMenu; @@ -18,7 +18,7 @@ class SlugSecurityListener protected $authorizationChecker; /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; @@ -33,7 +33,7 @@ class SlugSecurityListener private $permissionsEnabled; public function __construct( - EntityManager $entityManager, + EntityManagerInterface $entityManager, AuthorizationCheckerInterface $authorizationChecker, NodeMenu $nodeMenu, $permissionsEnabled = true diff --git a/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php b/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php index 363c470f6e..30314cd0ed 100644 --- a/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php +++ b/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionAdmin; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMapInterface; @@ -69,7 +69,7 @@ public function bindRequest(Request $request) $this->permissionAdmin->bindRequest($request); } - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { } diff --git a/src/Kunstmaan/NodeBundle/Helper/Menu/ActionsMenuBuilder.php b/src/Kunstmaan/NodeBundle/Helper/Menu/ActionsMenuBuilder.php index 20de4b6d10..ac20966e29 100644 --- a/src/Kunstmaan/NodeBundle/Helper/Menu/ActionsMenuBuilder.php +++ b/src/Kunstmaan/NodeBundle/Helper/Menu/ActionsMenuBuilder.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Helper\Menu; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Knp\Menu\FactoryInterface; use Knp\Menu\ItemInterface; use Kunstmaan\AdminBundle\Entity\UserInterface; @@ -30,7 +30,7 @@ class ActionsMenuBuilder private $activeNodeVersion; /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -72,7 +72,7 @@ class ActionsMenuBuilder */ public function __construct( FactoryInterface $factory, - EntityManager $em, + EntityManagerInterface $em, RouterInterface $router, EventDispatcherInterface $dispatcher, AuthorizationCheckerInterface $authorizationChecker, diff --git a/src/Kunstmaan/NodeBundle/Helper/NodeAdmin/NodeAdminPublisher.php b/src/Kunstmaan/NodeBundle/Helper/NodeAdmin/NodeAdminPublisher.php index 8fc4c552e1..6afd9024f7 100644 --- a/src/Kunstmaan/NodeBundle/Helper/NodeAdmin/NodeAdminPublisher.php +++ b/src/Kunstmaan/NodeBundle/Helper/NodeAdmin/NodeAdminPublisher.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Helper\NodeAdmin; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\BaseUser; use Kunstmaan\AdminBundle\FlashMessages\FlashTypes; use Kunstmaan\AdminBundle\Helper\CloneHelper; @@ -25,7 +25,7 @@ class NodeAdminPublisher { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -53,14 +53,14 @@ class NodeAdminPublisher private $translator; /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager * @param TokenStorageInterface $tokenStorage The security token storage * @param AuthorizationCheckerInterface $authorizationChecker The security authorization checker * @param EventDispatcherInterface $eventDispatcher The Event dispatcher * @param CloneHelper $cloneHelper The clone helper */ public function __construct( - EntityManager $em, + EntityManagerInterface $em, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, EventDispatcherInterface $eventDispatcher, diff --git a/src/Kunstmaan/NodeBundle/Helper/NodeMenuItem.php b/src/Kunstmaan/NodeBundle/Helper/NodeMenuItem.php index e43cdc7860..bd33f8a889 100644 --- a/src/Kunstmaan/NodeBundle/Helper/NodeMenuItem.php +++ b/src/Kunstmaan/NodeBundle/Helper/NodeMenuItem.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Helper; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeBundle\Entity\NodeTranslation; @@ -13,7 +13,7 @@ class NodeMenuItem { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/NodeBundle/Helper/URLHelper.php b/src/Kunstmaan/NodeBundle/Helper/URLHelper.php index 8f8d12e537..da967cb379 100644 --- a/src/Kunstmaan/NodeBundle/Helper/URLHelper.php +++ b/src/Kunstmaan/NodeBundle/Helper/URLHelper.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Helper; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Kunstmaan\NodeBundle\Validation\URLValidator; use Psr\Log\LoggerInterface; @@ -16,7 +16,7 @@ class URLHelper use URLValidator; /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -41,7 +41,7 @@ class URLHelper */ private $domainConfiguration; - public function __construct(EntityManager $em, RouterInterface $router, LoggerInterface $logger, DomainConfigurationInterface $domainConfiguration) + public function __construct(EntityManagerInterface $em, RouterInterface $router, LoggerInterface $logger, DomainConfigurationInterface $domainConfiguration) { $this->em = $em; $this->router = $router; diff --git a/src/Kunstmaan/NodeBundle/Tests/Entity/NodeTranslationTest.php b/src/Kunstmaan/NodeBundle/Tests/Entity/NodeTranslationTest.php index 17d674f58d..1e6d8372dc 100644 --- a/src/Kunstmaan/NodeBundle/Tests/Entity/NodeTranslationTest.php +++ b/src/Kunstmaan/NodeBundle/Tests/Entity/NodeTranslationTest.php @@ -3,7 +3,7 @@ namespace Kunstmaan\NodeBundle\Tests\Entity; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeBundle\Entity\NodeTranslation; @@ -175,7 +175,7 @@ public function testGetSetRef() $entity = new NodeVersion(); $entity->setType(NodeVersion::PUBLIC_VERSION); - $em = $this->getMockBuilder(EntityManager::class) + $em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/src/Kunstmaan/NodeBundle/Tests/Entity/NodeVersionTest.php b/src/Kunstmaan/NodeBundle/Tests/Entity/NodeVersionTest.php index 29f0c08c6e..9b746d021c 100644 --- a/src/Kunstmaan/NodeBundle/Tests/Entity/NodeVersionTest.php +++ b/src/Kunstmaan/NodeBundle/Tests/Entity/NodeVersionTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Tests\Entity; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; use Kunstmaan\NodeBundle\Entity\NodeTranslation; @@ -59,7 +59,7 @@ public function testGetSetRef() $entity = $this->createMock(HasNodeInterface::class); $entity->method('getId')->willReturn(1); - $em = $this->getMockBuilder(EntityManager::class) + $em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/src/Kunstmaan/NodeBundle/Tests/Helper/Menu/ActionsMenuBuilderTest.php b/src/Kunstmaan/NodeBundle/Tests/Helper/Menu/ActionsMenuBuilderTest.php index 6002872e77..200c2bb96b 100644 --- a/src/Kunstmaan/NodeBundle/Tests/Helper/Menu/ActionsMenuBuilderTest.php +++ b/src/Kunstmaan/NodeBundle/Tests/Helper/Menu/ActionsMenuBuilderTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeBundle\Tests\Helper\Menu; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Knp\Menu\Integration\Symfony\RoutingExtension; use Knp\Menu\MenuFactory; @@ -44,7 +44,7 @@ protected function setUp(): void } /** - * @return \Doctrine\ORM\EntityManager + * @return EntityManagerInterface * * @throws \Exception */ @@ -55,7 +55,7 @@ protected function getMockedEntityManager() $repository->method('findBy')->willReturn(null); $repository->method('findOneBy')->willReturn(null); - $emMock = $this->createMock(EntityManager::class); + $emMock = $this->createMock(EntityManagerInterface::class); $emMock->method('getRepository')->willReturn($repository); $emMock->method('getClassMetaData')->willReturn((object) ['name' => 'aClass']); $emMock->method('persist')->willReturn(null); diff --git a/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php b/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php index 9a7dfd1baa..9e0689f29a 100644 --- a/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php +++ b/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php @@ -2,7 +2,6 @@ namespace Kunstmaan\NodeBundle\Tests\Helper; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ObjectRepository; use Kunstmaan\AdminBundle\Entity\User; @@ -649,7 +648,7 @@ private function createORM() ->disableOriginalConstructor() ->getMock(); - $this->em = $this->getMockBuilder(EntityManager::class) + $this->em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); } diff --git a/src/Kunstmaan/NodeBundle/Tests/Helper/UrlHelperTest.php b/src/Kunstmaan/NodeBundle/Tests/Helper/UrlHelperTest.php index 165cd81db2..fb66118d15 100644 --- a/src/Kunstmaan/NodeBundle/Tests/Helper/UrlHelperTest.php +++ b/src/Kunstmaan/NodeBundle/Tests/Helper/UrlHelperTest.php @@ -5,7 +5,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Schema\Schema; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Kunstmaan\NodeBundle\Helper\URLHelper; use PHPUnit\Framework\TestCase; @@ -35,7 +35,7 @@ static function (Connection $connection): void { public function testReplaceUrlWithEmail() { - $em = $this->getMockBuilder(EntityManager::class)->disableOriginalConstructor()->getMock(); + $em = $this->getMockBuilder(EntityManagerInterface::class)->disableOriginalConstructor()->getMock(); $router = $this->getMockBuilder(RouterInterface::class)->getMock(); $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $domainConfig = $this->getMockBuilder(DomainConfigurationInterface::class)->getMock(); @@ -47,7 +47,7 @@ public function testReplaceUrlWithEmail() public function testReplaceUrlWithInternalLink() { - $em = $this->getMockBuilder(EntityManager::class)->disableOriginalConstructor()->getMock(); + $em = $this->getMockBuilder(EntityManagerInterface::class)->disableOriginalConstructor()->getMock(); $em->expects($this->once())->method('getConnection')->willReturn($this->connection); $router = $this->getMockBuilder(RouterInterface::class)->getMock(); $router->method('generate')->with('_slug', ['url' => 'abc-3'])->willReturn('/abc-3'); @@ -65,7 +65,7 @@ public function testReplaceUrlWithInternalLink() public function testReplaceUrlWithMediaLink() { - $em = $this->getMockBuilder(EntityManager::class)->disableOriginalConstructor()->getMock(); + $em = $this->getMockBuilder(EntityManagerInterface::class)->disableOriginalConstructor()->getMock(); $em->expects($this->once())->method('getConnection')->willReturn($this->connection); $router = $this->getMockBuilder(RouterInterface::class)->getMock(); $router->method('generate')->with('_slug', ['url' => 'abc'])->willReturn('/abc'); diff --git a/src/Kunstmaan/NodeSearchBundle/Configuration/NodePagesConfiguration.php b/src/Kunstmaan/NodeSearchBundle/Configuration/NodePagesConfiguration.php index 6548fa853d..3e5febd213 100644 --- a/src/Kunstmaan/NodeSearchBundle/Configuration/NodePagesConfiguration.php +++ b/src/Kunstmaan/NodeSearchBundle/Configuration/NodePagesConfiguration.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeSearchBundle\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Elastica\Index; use Elastica\Mapping; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; @@ -47,7 +47,7 @@ class NodePagesConfiguration implements SearchConfigurationInterface /** @var array */ protected $analyzerLanguages; - /** @var EntityManager */ + /** @var EntityManagerInterface */ protected $em; /** @var array */ diff --git a/src/Kunstmaan/NodeSearchBundle/EventListener/NodeListener.php b/src/Kunstmaan/NodeSearchBundle/EventListener/NodeListener.php index 1c2a4bf6da..3c4c097388 100644 --- a/src/Kunstmaan/NodeSearchBundle/EventListener/NodeListener.php +++ b/src/Kunstmaan/NodeSearchBundle/EventListener/NodeListener.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeSearchBundle\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\Tab; use Kunstmaan\NodeBundle\Event\AdaptFormEvent; use Kunstmaan\NodeSearchBundle\Form\NodeSearchAdminType; @@ -13,10 +13,10 @@ */ class NodeListener { - /** @var EntityManager */ + /** @var EntityManagerInterface */ private $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/NodeSearchBundle/Helper/FormWidgets/SearchFormWidget.php b/src/Kunstmaan/NodeSearchBundle/Helper/FormWidgets/SearchFormWidget.php index a68a6d670c..ee34c57fe7 100644 --- a/src/Kunstmaan/NodeSearchBundle/Helper/FormWidgets/SearchFormWidget.php +++ b/src/Kunstmaan/NodeSearchBundle/Helper/FormWidgets/SearchFormWidget.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeSearchBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeSearchBundle\Entity\NodeSearch; @@ -17,7 +17,7 @@ class SearchFormWidget extends FormWidget /** @var NodeSearch */ private $nodeSearch; - public function __construct(Node $node, EntityManager $em) + public function __construct(Node $node, EntityManagerInterface $em) { $this->node = $node; $this->nodeSearch = $em->getRepository(NodeSearch::class)->findOneByNode($this->node); @@ -40,7 +40,7 @@ public function bindRequest(Request $request) $this->data['node_search'] = $form['node_search']['boost']; } - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { $nodeSearch = $em->getRepository(NodeSearch::class)->findOneByNode($this->node); diff --git a/src/Kunstmaan/NodeSearchBundle/Search/NodeSearcher.php b/src/Kunstmaan/NodeSearchBundle/Search/NodeSearcher.php index 6bc3e4652c..b4246c3152 100644 --- a/src/Kunstmaan/NodeSearchBundle/Search/NodeSearcher.php +++ b/src/Kunstmaan/NodeSearchBundle/Search/NodeSearcher.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeSearchBundle\Search; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Elastica\Query; use Elastica\Query\BoolQuery; use Elastica\Query\MatchQuery; @@ -34,7 +34,7 @@ class NodeSearcher extends AbstractElasticaSearcher protected $domainConfiguration; /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; @@ -53,7 +53,7 @@ public function setDomainConfiguration(DomainConfigurationInterface $domainConfi $this->domainConfiguration = $domainConfiguration; } - public function setEntityManager(EntityManager $em) + public function setEntityManager(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/NodeSearchBundle/Tests/EventListener/NodeIndexUpdateEventListenerTest.php b/src/Kunstmaan/NodeSearchBundle/Tests/EventListener/NodeIndexUpdateEventListenerTest.php index e792be20d0..1e596251f7 100644 --- a/src/Kunstmaan/NodeSearchBundle/Tests/EventListener/NodeIndexUpdateEventListenerTest.php +++ b/src/Kunstmaan/NodeSearchBundle/Tests/EventListener/NodeIndexUpdateEventListenerTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeSearchBundle\Tests\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\NodeBundle\Entity\AbstractPage; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeBundle\Entity\NodeTranslation; @@ -39,7 +39,7 @@ public function testUpdateOfChildPageWithStructuredNodeParent() $nodeEvent->method('getNodeTranslation')->willReturn($nodeTranslation); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $listener = new NodeIndexUpdateEventListener($this->getSearchConfiguration(true), $em); $listener->onPostPersist($nodeEvent); } @@ -77,7 +77,7 @@ public function testUpdateOfChildPageWithStructuredNodeParentAndOfflineParent() $nodeEvent->method('getNodeTranslation')->willReturn($nodeTranslation); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $listener = new NodeIndexUpdateEventListener($this->getSearchConfiguration(false), $em); $listener->onPostPersist($nodeEvent); } @@ -104,7 +104,7 @@ public function testUpdateOfChildPageWithOfflineParent() $nodeEvent->method('getNodeTranslation')->willReturn($nodeTranslation); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $listener = new NodeIndexUpdateEventListener($this->getSearchConfiguration(false), $em); $listener->onPostPersist($nodeEvent); } @@ -131,7 +131,7 @@ public function testUpdateOfChildPageWithOnlineParent() $nodeEvent->method('getNodeTranslation')->willReturn($nodeTranslation); - $em = $this->createMock(EntityManager::class); + $em = $this->createMock(EntityManagerInterface::class); $listener = new NodeIndexUpdateEventListener($this->getSearchConfiguration(true), $em); $listener->onPostPersist($nodeEvent); } diff --git a/src/Kunstmaan/NodeSearchBundle/Twig/KunstmaanNodeSearchTwigExtension.php b/src/Kunstmaan/NodeSearchBundle/Twig/KunstmaanNodeSearchTwigExtension.php index beb779a424..78c9ab8fba 100644 --- a/src/Kunstmaan/NodeSearchBundle/Twig/KunstmaanNodeSearchTwigExtension.php +++ b/src/Kunstmaan/NodeSearchBundle/Twig/KunstmaanNodeSearchTwigExtension.php @@ -2,7 +2,7 @@ namespace Kunstmaan\NodeSearchBundle\Twig; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; use Kunstmaan\NodeBundle\Entity\Node; use Kunstmaan\NodeSearchBundle\Helper\IndexablePagePartsService; @@ -14,7 +14,7 @@ final class KunstmaanNodeSearchTwigExtension extends AbstractExtension { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -23,7 +23,7 @@ final class KunstmaanNodeSearchTwigExtension extends AbstractExtension */ private $indexablePagePartsService; - public function __construct(EntityManager $em, IndexablePagePartsService $indexablePagePartsService) + public function __construct(EntityManagerInterface $em, IndexablePagePartsService $indexablePagePartsService) { $this->em = $em; $this->indexablePagePartsService = $indexablePagePartsService; diff --git a/src/Kunstmaan/PagePartBundle/Entity/PagePartRef.php b/src/Kunstmaan/PagePartBundle/Entity/PagePartRef.php index 177c8dce87..1a416721eb 100644 --- a/src/Kunstmaan/PagePartBundle/Entity/PagePartRef.php +++ b/src/Kunstmaan/PagePartBundle/Entity/PagePartRef.php @@ -2,7 +2,7 @@ namespace Kunstmaan\PagePartBundle\Entity; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping as ORM; use Kunstmaan\PagePartBundle\Repository\PagePartRefRepository; @@ -275,7 +275,7 @@ public function __toString() /** * @return \Kunstmaan\PagePartBundle\Helper\PagePartInterface */ - public function getPagePart(EntityManager $em) + public function getPagePart(EntityManagerInterface $em) { return $em->getRepository($this->getPagePartEntityname())->find($this->getPagePartId()); } diff --git a/src/Kunstmaan/PagePartBundle/Entity/PageTemplateConfiguration.php b/src/Kunstmaan/PagePartBundle/Entity/PageTemplateConfiguration.php index 8e531484aa..489bb536e0 100644 --- a/src/Kunstmaan/PagePartBundle/Entity/PageTemplateConfiguration.php +++ b/src/Kunstmaan/PagePartBundle/Entity/PageTemplateConfiguration.php @@ -2,7 +2,7 @@ namespace Kunstmaan\PagePartBundle\Entity; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping as ORM; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\NodeBundle\Entity\PageInterface; @@ -110,7 +110,7 @@ public function setPageTemplate($pageTemplate) /** * @return PageInterface */ - public function getPage(EntityManager $em) + public function getPage(EntityManagerInterface $em) { return $em->getRepository($this->getPageEntityName())->find($this->getPageId()); } diff --git a/src/Kunstmaan/PagePartBundle/EventListener/CloneListener.php b/src/Kunstmaan/PagePartBundle/EventListener/CloneListener.php index 9810d15edb..c86f1f1cec 100644 --- a/src/Kunstmaan/PagePartBundle/EventListener/CloneListener.php +++ b/src/Kunstmaan/PagePartBundle/EventListener/CloneListener.php @@ -2,7 +2,6 @@ namespace Kunstmaan\PagePartBundle\EventListener; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Event\DeepCloneAndSaveEvent; use Kunstmaan\PagePartBundle\Entity\PagePartRef; @@ -17,7 +16,7 @@ class CloneListener { /** - * @var EntityManager|EntityManagerInterface + * @var EntityManagerInterface */ private $em; diff --git a/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PagePartWidget.php b/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PagePartWidget.php index 937879eab4..63ae3a7b20 100644 --- a/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PagePartWidget.php +++ b/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PagePartWidget.php @@ -2,7 +2,6 @@ namespace Kunstmaan\PagePartBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; @@ -86,9 +85,9 @@ public function bindRequest(Request $request) } /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface$em The entity manager */ - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { parent::persist($em); diff --git a/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PageTemplateWidget.php b/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PageTemplateWidget.php index e9361f5e5e..e99a3b726e 100644 --- a/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PageTemplateWidget.php +++ b/src/Kunstmaan/PagePartBundle/Helper/FormWidgets/PageTemplateWidget.php @@ -2,7 +2,6 @@ namespace Kunstmaan\PagePartBundle\Helper\FormWidgets; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\NodeBundle\Entity\PageInterface; @@ -168,9 +167,9 @@ public function bindRequest(Request $request) } /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager */ - public function persist(EntityManager $em) + public function persist(EntityManagerInterface $em) { $em->persist($this->pageTemplateConfiguration); foreach ($this->widgets as $widget) { diff --git a/src/Kunstmaan/PagePartBundle/Helper/Services/PagePartCreatorService.php b/src/Kunstmaan/PagePartBundle/Helper/Services/PagePartCreatorService.php index e5bb6945e4..1d1b137928 100644 --- a/src/Kunstmaan/PagePartBundle/Helper/Services/PagePartCreatorService.php +++ b/src/Kunstmaan/PagePartBundle/Helper/Services/PagePartCreatorService.php @@ -2,7 +2,6 @@ namespace Kunstmaan\PagePartBundle\Helper\Services; -use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\EntityInterface; use Kunstmaan\NodeBundle\Entity\Node; @@ -26,7 +25,7 @@ class PagePartCreatorService { /** - * @var EntityManagerInterface|EntityManager + * @var EntityManagerInterface */ protected $em; @@ -46,7 +45,7 @@ class PagePartCreatorService protected $nodeRepo; /** - * Sets the EntityManager dependency. + * Sets the EntityManagerInterface dependency. */ public function setEntityManager(EntityManagerInterface $em) { diff --git a/src/Kunstmaan/PagePartBundle/Repository/PagePartRefRepository.php b/src/Kunstmaan/PagePartBundle/Repository/PagePartRefRepository.php index 9b6e8045d3..4575b03fe4 100644 --- a/src/Kunstmaan/PagePartBundle/Repository/PagePartRefRepository.php +++ b/src/Kunstmaan/PagePartBundle/Repository/PagePartRefRepository.php @@ -2,7 +2,7 @@ namespace Kunstmaan\PagePartBundle\Repository; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\AdminBundle\Entity\DeepCloneInterface; use Kunstmaan\AdminBundle\Entity\EntityInterface; @@ -113,12 +113,12 @@ public function getPageParts(HasPagePartsInterface $page, $context = 'main') } /** - * @param EntityManager $em The entity manager - * @param HasPagePartsInterface $fromPage The page from where you copy the pageparts - * @param HasPagePartsInterface $toPage The page to where you want to copy the pageparts - * @param string $context The pagepart context + * @param EntityManagerInterface $em The entity manager + * @param HasPagePartsInterface $fromPage The page from where you copy the pageparts + * @param HasPagePartsInterface $toPage The page to where you want to copy the pageparts + * @param string $context The pagepart context */ - public function copyPageParts(EntityManager $em, HasPagePartsInterface $fromPage, HasPagePartsInterface $toPage, $context = 'main') + public function copyPageParts(EntityManagerInterface $em, HasPagePartsInterface $fromPage, HasPagePartsInterface $toPage, $context = 'main') { $fromPageParts = $this->getPageParts($fromPage, $context); $sequenceNumber = 1; diff --git a/src/Kunstmaan/PagePartBundle/Tests/Entity/PagePartRefTest.php b/src/Kunstmaan/PagePartBundle/Tests/Entity/PagePartRefTest.php index fe91dc56f4..55a777b575 100644 --- a/src/Kunstmaan/PagePartBundle/Tests/Entity/PagePartRefTest.php +++ b/src/Kunstmaan/PagePartBundle/Tests/Entity/PagePartRefTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\PagePartBundle\Tests\Entity; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\PagePartBundle\Entity\PagePartRef; use PHPUnit\Framework\TestCase; @@ -23,7 +23,7 @@ public function testGetSet() $part->setPagePartId('4'); $part->setPagePartEntityname(PagePartRef::class); - $em = $this->getMockBuilder(EntityManager::class) + $em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/src/Kunstmaan/PagePartBundle/Tests/Entity/PageTemplateConfigurationTest.php b/src/Kunstmaan/PagePartBundle/Tests/Entity/PageTemplateConfigurationTest.php index 4deafb5ae2..c1aa725b5a 100644 --- a/src/Kunstmaan/PagePartBundle/Tests/Entity/PageTemplateConfigurationTest.php +++ b/src/Kunstmaan/PagePartBundle/Tests/Entity/PageTemplateConfigurationTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\PagePartBundle\Tests\Entity; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\NodeBundle\Entity\AbstractPage; use Kunstmaan\PagePartBundle\Entity\PageTemplateConfiguration; @@ -22,7 +22,7 @@ public function testGetSet() $this->assertEquals(PageTemplate::class, $config->getPageEntityName()); $this->assertEquals('string!', $config->getPageTemplate()); - $em = $this->getMockBuilder(EntityManager::class) + $em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartTwigExtension.php b/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartTwigExtension.php index cf751c5bcc..9bc479d4f8 100644 --- a/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartTwigExtension.php +++ b/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartTwigExtension.php @@ -2,7 +2,7 @@ namespace Kunstmaan\PagePartBundle\Twig\Extension; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\PagePartBundle\Entity\PagePartRef; use Kunstmaan\PagePartBundle\Helper\HasPagePartsInterface; use Kunstmaan\PagePartBundle\Helper\PagePartInterface; @@ -14,11 +14,11 @@ final class PagePartTwigExtension extends AbstractExtension { /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/RedirectBundle/AdminList/RedirectAdminListConfigurator.php b/src/Kunstmaan/RedirectBundle/AdminList/RedirectAdminListConfigurator.php index 4a7906c7ce..25e7abac73 100644 --- a/src/Kunstmaan/RedirectBundle/AdminList/RedirectAdminListConfigurator.php +++ b/src/Kunstmaan/RedirectBundle/AdminList/RedirectAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\RedirectBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; @@ -17,7 +17,7 @@ class RedirectAdminListConfigurator extends AbstractDoctrineORMAdminListConfigur */ private $domainConfiguration; - public function __construct(EntityManager $em, ?AclHelper $aclHelper, DomainConfigurationInterface $domainConfiguration) + public function __construct(EntityManagerInterface $em, ?AclHelper $aclHelper, DomainConfigurationInterface $domainConfiguration) { parent::__construct($em, $aclHelper); diff --git a/src/Kunstmaan/RedirectBundle/Tests/AdminList/RedirectAdminListConfiguratorTest.php b/src/Kunstmaan/RedirectBundle/Tests/AdminList/RedirectAdminListConfiguratorTest.php index 3e9996ee6c..81744dba37 100644 --- a/src/Kunstmaan/RedirectBundle/Tests/AdminList/RedirectAdminListConfiguratorTest.php +++ b/src/Kunstmaan/RedirectBundle/Tests/AdminList/RedirectAdminListConfiguratorTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\RedirectBundle\Tests\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Field; use Kunstmaan\RedirectBundle\AdminList\RedirectAdminListConfigurator; @@ -11,7 +11,7 @@ class RedirectAdminListConfiguratorTest extends TestCase { /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; diff --git a/src/Kunstmaan/SeoBundle/Entity/Seo.php b/src/Kunstmaan/SeoBundle/Entity/Seo.php index 91f73ec93f..3d908c71d8 100644 --- a/src/Kunstmaan/SeoBundle/Entity/Seo.php +++ b/src/Kunstmaan/SeoBundle/Entity/Seo.php @@ -2,7 +2,7 @@ namespace Kunstmaan\SeoBundle\Entity; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping as ORM; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\MediaBundle\Entity\Media; @@ -537,7 +537,7 @@ public function setRef(AbstractEntity $entity) /** * @return AbstractEntity */ - public function getRef(EntityManager $em) + public function getRef(EntityManagerInterface $em) { return $em->getRepository($this->getRefEntityName())->find($this->getRefId()); } diff --git a/src/Kunstmaan/SeoBundle/EventListener/CloneListener.php b/src/Kunstmaan/SeoBundle/EventListener/CloneListener.php index fff9c77839..68b8ad3835 100644 --- a/src/Kunstmaan/SeoBundle/EventListener/CloneListener.php +++ b/src/Kunstmaan/SeoBundle/EventListener/CloneListener.php @@ -2,7 +2,7 @@ namespace Kunstmaan\SeoBundle\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\AdminBundle\Event\DeepCloneAndSaveEvent; use Kunstmaan\AdminBundle\Helper\CloneHelper; @@ -14,7 +14,7 @@ class CloneListener { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -24,10 +24,10 @@ class CloneListener private $cloneHelper; /** - * @param EntityManager $em The entity manager - * @param CloneHelper $cloneHelper The clone helper + * @param EntityManagerInterface $em The entity manager + * @param CloneHelper $cloneHelper The clone helper */ - public function __construct(EntityManager $em, CloneHelper $cloneHelper) + public function __construct(EntityManagerInterface $em, CloneHelper $cloneHelper) { $this->em = $em; $this->cloneHelper = $cloneHelper; diff --git a/src/Kunstmaan/SeoBundle/EventListener/NodeListener.php b/src/Kunstmaan/SeoBundle/EventListener/NodeListener.php index 7a67988cfd..2b2c76eab0 100644 --- a/src/Kunstmaan/SeoBundle/EventListener/NodeListener.php +++ b/src/Kunstmaan/SeoBundle/EventListener/NodeListener.php @@ -2,7 +2,7 @@ namespace Kunstmaan\SeoBundle\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\FormWidgets\FormWidget; use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\Tab; use Kunstmaan\NodeBundle\Entity\HasNodeInterface; @@ -17,11 +17,11 @@ class NodeListener { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/SeoBundle/Tests/DependencyInjection/KunstmaanSeoExtensionTest.php b/src/Kunstmaan/SeoBundle/Tests/DependencyInjection/KunstmaanSeoExtensionTest.php index 4db51b554f..a03f0c711f 100644 --- a/src/Kunstmaan/SeoBundle/Tests/DependencyInjection/KunstmaanSeoExtensionTest.php +++ b/src/Kunstmaan/SeoBundle/Tests/DependencyInjection/KunstmaanSeoExtensionTest.php @@ -2,7 +2,7 @@ namespace Kunstmaan\SeoBundle\Tests\DependencyInjection; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\CloneHelper; use Kunstmaan\SeoBundle\DependencyInjection\KunstmaanSeoExtension; use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; @@ -18,7 +18,7 @@ protected function setUp(): void { parent::setUp(); - $this->registerService('doctrine.orm.entity_manager', EntityManager::class); + $this->registerService('doctrine.orm.entity_manager', EntityManagerInterface::class); $this->registerService('kunstmaan_admin.clone.helper', CloneHelper::class); $this->registerService('security.authorization_checker', AuthorizationChecker::class); $this->registerService('translator', TranslatorInterface::class); diff --git a/src/Kunstmaan/SeoBundle/Twig/SeoTwigExtension.php b/src/Kunstmaan/SeoBundle/Twig/SeoTwigExtension.php index 2899de6ec1..f2b9a8ba58 100644 --- a/src/Kunstmaan/SeoBundle/Twig/SeoTwigExtension.php +++ b/src/Kunstmaan/SeoBundle/Twig/SeoTwigExtension.php @@ -2,7 +2,7 @@ namespace Kunstmaan\SeoBundle\Twig; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\NodeBundle\Entity\AbstractPage; use Kunstmaan\SeoBundle\Entity\Seo; @@ -17,7 +17,7 @@ final class SeoTwigExtension extends AbstractExtension { /** - * @var EntityManager + * @var EntityManagerInterface */ protected $em; @@ -41,7 +41,7 @@ final class SeoTwigExtension extends AbstractExtension */ private $requestCache; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/TaggingBundle/AdminList/TagAdminListConfigurator.php b/src/Kunstmaan/TaggingBundle/AdminList/TagAdminListConfigurator.php index 7fc629add9..ff88735ce6 100644 --- a/src/Kunstmaan/TaggingBundle/AdminList/TagAdminListConfigurator.php +++ b/src/Kunstmaan/TaggingBundle/AdminList/TagAdminListConfigurator.php @@ -2,7 +2,7 @@ namespace Kunstmaan\TaggingBundle\AdminList; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminListBundle\AdminList\Configurator\AbstractDoctrineORMAdminListConfigurator; use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM; @@ -11,10 +11,10 @@ class TagAdminListConfigurator extends AbstractDoctrineORMAdminListConfigurator { /** - * @param EntityManager $em The entity manager + * @param EntityManagerInterface $em The entity manager * @param AclHelper $aclHelper The acl helper */ - public function __construct(EntityManager $em, AclHelper $aclHelper = null) + public function __construct(EntityManagerInterface $em, AclHelper $aclHelper = null) { parent::__construct($em, $aclHelper); $this->setAdminType(TagAdminType::class); diff --git a/src/Kunstmaan/TaggingBundle/EventListener/CloneListener.php b/src/Kunstmaan/TaggingBundle/EventListener/CloneListener.php index 302508d9ef..00290563e9 100644 --- a/src/Kunstmaan/TaggingBundle/EventListener/CloneListener.php +++ b/src/Kunstmaan/TaggingBundle/EventListener/CloneListener.php @@ -2,7 +2,7 @@ namespace Kunstmaan\TaggingBundle\EventListener; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use DoctrineExtensions\Taggable\Taggable; use Kunstmaan\AdminBundle\Event\DeepCloneAndSaveEvent; use Kunstmaan\TaggingBundle\Entity\Tag; @@ -14,7 +14,7 @@ class CloneListener { protected $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; } diff --git a/src/Kunstmaan/TaggingBundle/Tests/Entity/TagManagerTest.php b/src/Kunstmaan/TaggingBundle/Tests/Entity/TagManagerTest.php index 407a69d223..e7f89fd3ec 100644 --- a/src/Kunstmaan/TaggingBundle/Tests/Entity/TagManagerTest.php +++ b/src/Kunstmaan/TaggingBundle/Tests/Entity/TagManagerTest.php @@ -8,7 +8,7 @@ use Doctrine\DBAL\Result; use Doctrine\ORM\AbstractQuery; use Doctrine\ORM\Configuration; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query\Expr; @@ -158,7 +158,7 @@ public function setUp(): void ->method('getResult') ->willReturn([]); - $em = $this->getMockBuilder(EntityManager::class) + $em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); @@ -196,7 +196,7 @@ public function testFindById() public function testFindByIdReturnsNull() { - $em = $this->getMockBuilder(EntityManager::class) + $em = $this->getMockBuilder(EntityManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/src/Kunstmaan/TranslatorBundle/Service/Migrations/MigrationsService.php b/src/Kunstmaan/TranslatorBundle/Service/Migrations/MigrationsService.php index a8ddc04692..093e416818 100644 --- a/src/Kunstmaan/TranslatorBundle/Service/Migrations/MigrationsService.php +++ b/src/Kunstmaan/TranslatorBundle/Service/Migrations/MigrationsService.php @@ -2,7 +2,7 @@ namespace Kunstmaan\TranslatorBundle\Service\Migrations; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\TranslatorBundle\Entity\Translation; class MigrationsService @@ -15,7 +15,7 @@ class MigrationsService private $translationRepository; /** - * @var EntityManager + * @var EntityManagerInterface */ private $entityManager; diff --git a/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php b/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php index 0c1027fad1..493c7090ad 100644 --- a/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php +++ b/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php @@ -2,7 +2,7 @@ namespace Kunstmaan\VotingBundle\Services; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Kunstmaan\VotingBundle\Entity\Facebook\FacebookLike; use Kunstmaan\VotingBundle\Entity\Facebook\FacebookSend; @@ -29,7 +29,7 @@ class RepositoryResolver /** * @param object $em entity manager */ - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; }