Skip to content

Commit

Permalink
Deprecated Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Jul 2, 2020
1 parent 4f26ac0 commit d544e66
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
9 changes: 7 additions & 2 deletions UPGRADE-1.x.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
UPGRADE 1.x
===========

### `Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle`

Deprecated `Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle`. Use `Sonata\Doctrine\Bridge\Symfony\SonataDoctrineBundle`
instead.

### `Sonata\Doctrine\Types\JsonType` has been deprecated

`doctrine/dbal` has a native implementation, `Doctrine\DBAL\Types\JsonType`, that
should be used instead.

### Tests

All files under the ``Tests`` directory are now correctly handled as internal test classes.
You can't extend them anymore, because they are only loaded when running internal tests.
All files under the ``Tests`` directory are now correctly handled as internal test classes.
You can't extend them anymore, because they are only loaded when running internal tests.
More information can be found in the [composer docs](https://getcomposer.org/doc/04-schema.md#autoload-dev).
3 changes: 3 additions & 0 deletions src/Bridge/Symfony/Bundle/SonataDoctrineBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @deprecated Since sonata-project/doctrine-extensions 1.x, to be removed in 2.0. Use Sonata\Doctrine\Bridge\Symfony\SonataDoctrineBundle instead.
*/
final class SonataDoctrineBundle extends Bundle
{
public function build(ContainerBuilder $container)
Expand Down
39 changes: 39 additions & 0 deletions src/Bridge/Symfony/SonataDoctrineBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Sonata\Doctrine\Bridge\Symfony;

use Sonata\Doctrine\Bridge\Symfony\DependencyInjection\Compiler\AdapterCompilerPass;
use Sonata\Doctrine\Bridge\Symfony\DependencyInjection\Compiler\MapperCompilerPass;
use Sonata\Doctrine\Bridge\Symfony\DependencyInjection\SonataDoctrineExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class SonataDoctrineBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new AdapterCompilerPass());
$container->addCompilerPass(new MapperCompilerPass());
}

public function getPath()
{
return __DIR__.'/..';
}

protected function getContainerExtensionClass()
{
return SonataDoctrineExtension::class;
}
}

0 comments on commit d544e66

Please sign in to comment.