Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AllBundles] Fix doctrine common deprecations and resolve doctrine bundle v2 incompatibility #2899

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"doctrine/inflector": "^1.4|^2.0",
"doctrine/orm": "^2.5",
"doctrine/dbal": "^2.9",
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
"doctrine/doctrine-bundle": "^1.12.3|^2.0.3",
"doctrine/doctrine-cache-bundle": "^1.2",
"doctrine/doctrine-migrations-bundle": "^1.3|^2.1",
"symfony/swiftmailer-bundle": "^2.3|^3.0",
Expand Down Expand Up @@ -124,7 +124,8 @@
"kunstmaan/voting-bundle": "self.version"
},
"conflict": {
"friendsofsymfony/user-bundle": "<2.0.0"
"friendsofsymfony/user-bundle": "<2.0.0",
"doctrine/persistence": "<1.3"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/AdminBundle/Service/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Kunstmaan\AdminBundle\Service;

use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Kunstmaan\AdminBundle\Entity\GroupInterface;

class GroupManager
Expand All @@ -12,7 +12,7 @@ class GroupManager
private $em;
/** @var string */
private $class;
/** @var ObjectRepository */
/** @var EntityRepository */
private $repository;

public function __construct(EntityManagerInterface $em, string $class)
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/AdminBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"babdev/pagerfanta-bundle": "^2.5",
"doctrine/orm": "^2.5",
"doctrine/dbal": "^2.5",
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
"doctrine/doctrine-bundle": "^1.12.3|^2.0.3",
"doctrine/doctrine-cache-bundle": "^1.2",
"friendsofsymfony/user-bundle": "^2.0",
"guzzlehttp/guzzle": "~6.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class AdminListController extends Controller
/**
* You can override this method to return the correct entity manager when using multiple databases ...
*
* @return \Doctrine\Common\Persistence\ObjectManager|object
* @return \Doctrine\Persistence\ObjectManager|object
*/
protected function getEntityManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kunstmaan\AdminListBundle\Controller;

use Kunstmaan\AdminListBundle\Entity\LockableEntityInterface;
use Kunstmaan\AdminListBundle\Service\EntityVersionLockService;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand All @@ -14,7 +15,7 @@ class EntityLockCheckController extends Controller
/**
* You can override this method to return the correct entity manager when using multiple databases ...
*
* @return \Doctrine\Common\Persistence\ObjectManager|object
* @return \Doctrine\Persistence\ObjectManager|object
*/
protected function getEntityManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Kunstmaan\AdminListBundle\Service;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use FOS\UserBundle\Model\User;
use Kunstmaan\AdminBundle\Entity\UserInterface;
use Kunstmaan\AdminListBundle\Entity\EntityVersionLock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function setUp(): void
[EntityVersionLock::class, $mockLockRepository],
[LockableEntity::class, $mockLockableRepository],
];
$mockObjectManager = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')
$mockObjectManager = $this->getMockBuilder('Doctrine\Persistence\ObjectManager')
->disableOriginalConstructor()
->getMock();
$mockObjectManager
Expand Down
3 changes: 3 additions & 0 deletions src/Kunstmaan/AdminListBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"kunstmaan/menu-bundle": "^5.2",
"kunstmaan/translator-bundle": "^5.2"
},
"conflict": {
"doctrine/persistence": "<1.3"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": { "Kunstmaan\\AdminListBundle\\": "" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Kunstmaan\FixturesBundle\Builder;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\FixturesBundle\Loader\Fixture;
use Kunstmaan\FixturesBundle\Parser\Parser;
use Kunstmaan\FixturesBundle\Populator\Populator;
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/FixturesBundle/Loader/FixtureLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Kunstmaan\FixturesBundle\Loader;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down
3 changes: 3 additions & 0 deletions src/Kunstmaan/FixturesBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"symfony/phpunit-bridge": "^5.1",
"phpunit/phpunit": "^8.5"
},
"conflict": {
"doctrine/persistence": "<1.3"
},
"autoload": {
"psr-4": {
"Kunstmaan\\FixturesBundle\\": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ function ($name) use ($generator, $container) {
/*
* Replace slash to backslash. Eg: CmsBundle:Blog/Comment --> CmsBundle:Blog\Comment
*
* @see \Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory::getMetadataFor()
* @see \Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getMetadataFor()
* @see \Doctrine\ORM\Mapping\ClassMetadataFactory::getFqcnFromAlias()
*/
if (!$this->isSymfony4()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\AdminBundle\Entity\Group;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\AdminBundle\Entity\Role;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\AdminBundle\Entity\User;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/GeneratorBundle/Generator/ArticleGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Kunstmaan\GeneratorBundle\Generator;

use Doctrine\Persistence\ManagerRegistry;
use Kunstmaan\GeneratorBundle\Helper\CommandAssistant;
use Kunstmaan\GeneratorBundle\Helper\GeneratorUtils;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
Expand Down Expand Up @@ -32,7 +32,7 @@ class ArticleGenerator extends KunstmaanGenerator
/**
* @param string $skeletonDir
*/
public function __construct(Filesystem $filesystem, RegistryInterface $registry, $skeletonDir, array $parentPages, CommandAssistant $assistant, ContainerInterface $container)
public function __construct(Filesystem $filesystem, ManagerRegistry $registry, $skeletonDir, array $parentPages, CommandAssistant $assistant, ContainerInterface $container)
{
parent::__construct($filesystem, $registry, $skeletonDir, $assistant, $container);
$this->parentPages = $parentPages;
Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/GeneratorBundle/Generator/ConfigGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Kunstmaan\GeneratorBundle\Generator;

use Doctrine\Persistence\ManagerRegistry;
use Kunstmaan\GeneratorBundle\Helper\CommandAssistant;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Filesystem\Filesystem;

Expand All @@ -15,7 +15,7 @@ class ConfigGenerator extends KunstmaanGenerator
/** @var bool */
private $newAuthentication;

public function __construct(Filesystem $filesystem, RegistryInterface $registry, $skeletonDir, CommandAssistant $assistant, ContainerInterface $container = null, bool $newAuthentication = false)
public function __construct(Filesystem $filesystem, ManagerRegistry $registry, $skeletonDir, CommandAssistant $assistant, ContainerInterface $container = null, bool $newAuthentication = false)
{
parent::__construct($filesystem, $registry, $skeletonDir, $assistant, $container);
$this->newAuthentication = $newAuthentication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
use Doctrine\ORM\Tools\EntityGenerator;
use Doctrine\ORM\Tools\EntityRepositoryGenerator;
use Doctrine\Persistence\ManagerRegistry;
use Kunstmaan\GeneratorBundle\Helper\CommandAssistant;
use Kunstmaan\GeneratorBundle\Helper\GeneratorUtils;
use Sensio\Bundle\GeneratorBundle\Generator\Generator;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
Expand All @@ -31,7 +31,7 @@ class KunstmaanGenerator extends Generator
protected $filesystem;

/**
* @var RegistryInterface
* @var ManagerRegistry
*/
protected $registry;

Expand All @@ -52,14 +52,14 @@ class KunstmaanGenerator extends Generator

/**
* @param Filesystem $filesystem The filesystem
* @param RegistryInterface $registry The registry
* @param ManagerRegistry $registry The registry
* @param string $skeletonDir The directory of the skeleton
* @param CommandAssistant $assistant The command assistant
* @param ContainerInterface $container The container
*/
public function __construct(
Filesystem $filesystem,
RegistryInterface $registry,
ManagerRegistry $registry,
$skeletonDir,
CommandAssistant $assistant,
ContainerInterface $container = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ final class Symfony4EntityRepositoryGenerator

use <entityClassName>;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Doctrine\Persistence\ManagerRegistry;

class <repository> extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, <entity>::class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory;
use Faker\Provider\DateTime;
use Faker\Provider\Lorem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getPageTemplates(): array
/**
* @param \Doctrine\ORM\EntityManagerInterface $em
*
* @return \Doctrine\Common\Persistence\ObjectRepository
* @return \Doctrine\Persistence\ObjectRepository
*/
public function getArticleRepository($em)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\AdminBundle\Entity\DashboardConfiguration;
use Kunstmaan\MediaBundle\Entity\Media;
use Kunstmaan\MediaBundle\Helper\RemoteVideo\RemoteVideoHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\SitemapBundle\Entity\SitemapPage;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;

use Kunstmaan\UtilitiesBundle\Helper\Slugifier;

Expand Down
4 changes: 4 additions & 0 deletions src/Kunstmaan/GeneratorBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"require": {
"php": "^7.2",
"doctrine/inflector": "^1.4|^2.0",
"doctrine/data-fixtures": "^1.5",
"fzaninotto/faker": "~1.6",
"kunstmaan/admin-bundle": "^5.9",
"kunstmaan/adminlist-bundle": "~5.2",
Expand All @@ -32,6 +33,9 @@
"symfony/phpunit-bridge": "^5.1",
"phpunit/phpunit": "^8.5"
},
"conflict": {
"doctrine/persistence": "<1.3"
},
"autoload": {
"psr-4": { "Kunstmaan\\GeneratorBundle\\": "" }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\MediaBundle\Entity\Folder;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Kunstmaan\MediaBundle\Form\Type;

use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\MediaBundle\Entity\Media;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/MediaBundle/Form/Type/MediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Kunstmaan\MediaBundle\Form\Type;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\MediaBundle\Helper\MediaManager;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/MediaBundle/Tests/Form/AbstractTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function setUp(): void
{
$formFactoryBuilderInterface = Forms::createFormFactoryBuilder();
$formFactoryBuilderInterface->addType(new URLChooserType());
$formFactoryBuilderInterface->addTypeGuesser(new DoctrineOrmTypeGuesser($this->createMock('Doctrine\Common\Persistence\ManagerRegistry')));
$formFactoryBuilderInterface->addTypeGuesser(new DoctrineOrmTypeGuesser($this->createMock('Doctrine\Persistence\ManagerRegistry')));
$this->factory = $formFactoryBuilderInterface->getFormFactory();
$this->dispatcher = $this->createMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/MediaBundle/Tests/Helper/FolderManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Kunstmaan\MediaBundle\Tests\Helper;

use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityRepository;
use Kunstmaan\MediaBundle\Entity\Folder;
use Kunstmaan\MediaBundle\Helper\FolderManager;
use PHPUnit\Framework\TestCase;

class FolderManagerTest extends TestCase
{
/**
* @var ObjectRepository
* @var EntityRepository
*/
protected $repository;

Expand Down
3 changes: 3 additions & 0 deletions src/Kunstmaan/MediaBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"symfony/phpunit-bridge": "^5.1",
"phpunit/phpunit": "^8.5"
},
"conflict": {
"doctrine/persistence": "<1.3"
},
"suggest": {
"ext-imagick": "to support PDF preview images"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Kunstmaan\NodeBundle\EventListener;

use Doctrine\Common\Persistence\Mapping\MappingException;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\Persistence\Mapping\MappingException;
use Kunstmaan\AdminBundle\FlashMessages\FlashTypes;
use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface;
use Kunstmaan\NodeBundle\Entity\HasNodeInterface;
Expand Down
Loading