Skip to content

Commit

Permalink
2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Nov 25, 2020
1 parent 99bfe25 commit fd87722
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 27 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,49 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.7.0](https://github.com/sonata-project/SonataTranslationBundle/compare/2.6.0...2.7.0) - 2020-11-25
### Added
- [[#416](https://github.com/sonata-project/SonataTranslationBundle/pull/416)]
Added support for `knplabs/doctrine-behaviors` 2.
([@franmomu](https://github.com/franmomu))
- [[#405](https://github.com/sonata-project/SonataTranslationBundle/pull/405)]
Added `SonataTranslationBundle.pt.xliff` to support Portuguese(Portugal)
language. ([@joelpro2](https://github.com/joelpro2))
- [[#375](https://github.com/sonata-project/SonataTranslationBundle/pull/375)]
Add support for SonataBlockBundle 4.0
([@franmomu](https://github.com/franmomu))

### Changed
- [[#408](https://github.com/sonata-project/SonataTranslationBundle/pull/408)]
Replaced deprecated `GetResponseEvent` with `RequestEvent`.
([@franmomu](https://github.com/franmomu))
- [[#391](https://github.com/sonata-project/SonataTranslationBundle/pull/391)]
Mark classes as final ([@franmomu](https://github.com/franmomu))

### Deprecated
- [[#393](https://github.com/sonata-project/SonataTranslationBundle/pull/393)]
Deprecated `Sonata\TranslationBundle\Test\DoctrineOrmTestCase`.
([@franmomu](https://github.com/franmomu))
- [[#393](https://github.com/sonata-project/SonataTranslationBundle/pull/393)]
Deprecated constructing `AbstractTranslatableAdminExtension` without the
default translation locale. ([@franmomu](https://github.com/franmomu))
- [[#393](https://github.com/sonata-project/SonataTranslationBundle/pull/393)]
Deprecated protected `AbstractTranslatableAdminExtension::getContainer()`
method. ([@franmomu](https://github.com/franmomu))
- [[#393](https://github.com/sonata-project/SonataTranslationBundle/pull/393)]
Deprecated protected
`AbstractTranslatableAdminExtension::getTranslationLocales()` method.
([@franmomu](https://github.com/franmomu))
- [[#393](https://github.com/sonata-project/SonataTranslationBundle/pull/393)]
Deprecated protected
`AbstractTranslatableAdminExtension::getDefaultTranslationLocale()` method.
([@franmomu](https://github.com/franmomu))
- [[#393](https://github.com/sonata-project/SonataTranslationBundle/pull/393)]
Deprecated constructing
`Sonata\TranslationBundle\Admin\Extension\Gedmo\TranslatableAdminExtension`
without an instance of `TranslatableListener` and `ManagerRegistry`.
([@franmomu](https://github.com/franmomu))

## [2.6.0](https://github.com/sonata-project/SonataTranslationBundle/compare/2.5.0...2.6.0) - 2020-09-04
### Added
- [[#368](https://github.com/sonata-project/SonataTranslationBundle/pull/368)] Twig 3 compatibility ([@jorrit](https://github.com/jorrit))
Expand Down
12 changes: 6 additions & 6 deletions src/Admin/Extension/AbstractTranslatableAdminExtension.php
Expand Up @@ -54,7 +54,7 @@ public function __construct(TranslatableChecker $translatableChecker, ?string $d
if (null === $defaultTranslationLocale) {
@trigger_error(sprintf(
'Omitting the argument 2 or passing other type than "string" to "%s()" is deprecated'
.' since sonata-project/translation-bundle 2.x and will be not possible in version 3.0.',
.' since sonata-project/translation-bundle 2.7 and will be not possible in version 3.0.',
__METHOD__
), E_USER_DEPRECATED);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ public function alterNewInstance(AdminInterface $admin, $object)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since version 2.x, to be removed in 3.0. Use dependency injection instead.
* @deprecated since version 2.7, to be removed in 3.0. Use dependency injection instead.
*
* @phpstan-param AdminInterface<object> $admin
*
Expand All @@ -127,7 +127,7 @@ public function alterNewInstance(AdminInterface $admin, $object)
protected function getContainer(AdminInterface $admin)
{
@trigger_error(sprintf(
'The "%s()" method is deprecated since sonata-project/translation-bundle 2.x and will be removed in 3.0.'
'The "%s()" method is deprecated since sonata-project/translation-bundle 2.7 and will be removed in 3.0.'
.' Use dependency injection instead.',
__METHOD__
), E_USER_DEPRECATED);
Expand All @@ -140,7 +140,7 @@ protected function getContainer(AdminInterface $admin)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since version 2.x, to be removed in 3.0.
* @deprecated since version 2.7, to be removed in 3.0.
*
* @phpstan-param AdminInterface<object> $admin
*
Expand All @@ -151,7 +151,7 @@ protected function getContainer(AdminInterface $admin)
protected function getTranslationLocales(AdminInterface $admin)
{
@trigger_error(sprintf(
'The "%s()" method is deprecated since sonata-project/translation-bundle 2.x and will be removed in 3.0.',
'The "%s()" method is deprecated since sonata-project/translation-bundle 2.7 and will be removed in 3.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand All @@ -161,7 +161,7 @@ protected function getTranslationLocales(AdminInterface $admin)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since version 2.x, to be removed in 3.0.
* @deprecated since version 2.7, to be removed in 3.0.
*
* Return the default locale if url parameter is not present.
*
Expand Down
6 changes: 3 additions & 3 deletions src/Admin/Extension/Gedmo/TranslatableAdminExtension.php
Expand Up @@ -22,7 +22,7 @@
use Sonata\TranslationBundle\Checker\TranslatableChecker;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down Expand Up @@ -52,7 +52,7 @@ public function __construct(
if (null === $translatableListener) {
@trigger_error(sprintf(
'Not passing an instance of "%s" as argument 2 to "%s()" is deprecated'
.' since sonata-project/translation-bundle 2.x and will be mandatory in 3.0.',
.' since sonata-project/translation-bundle 2.7 and will be mandatory in 3.0.',
TranslatableListener::class,
__METHOD__
), E_USER_DEPRECATED);
Expand All @@ -63,7 +63,7 @@ public function __construct(
if (null === $managerRegistry) {
@trigger_error(sprintf(
'Not passing an instance of "%s" as argument 3 to "%s()" is deprecated'
.' since sonata-project/translation-bundle 2.x and will be mandatory in 3.0.',
.' since sonata-project/translation-bundle 2.7 and will be mandatory in 3.0.',
ManagerRegistry::class,
__METHOD__
), E_USER_DEPRECATED);
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Extension/Knplabs/TranslatableAdminExtension.php
Expand Up @@ -17,7 +17,7 @@
use Sonata\TranslationBundle\Admin\Extension\AbstractTranslatableAdminExtension;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Alfonso Machado <email@alfonsomachado.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Extension/Phpcr/TranslatableAdminExtension.php
Expand Up @@ -21,7 +21,7 @@
use Sonata\TranslationBundle\Checker\TranslatableChecker;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Block/LocaleSwitcherBlockService.php
Expand Up @@ -22,7 +22,7 @@
use Twig\Environment;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down Expand Up @@ -64,7 +64,7 @@ public function __construct(
$this->showCountryFlags = $showCountryFlagsOrTemplating;
} elseif (null === $showCountryFlagsOrTemplating || $showCountryFlagsOrTemplating instanceof EngineInterface) {
@trigger_error(sprintf(
'Passing "%s" as argument 2 to "%s()" is deprecated since sonata-project/translation-bundle 2.x'
'Passing "%s" as argument 2 to "%s()" is deprecated since sonata-project/translation-bundle 2.7'
.' and will throw a "%s" error in version 3.0. You must pass a "bool" value instead.',
null === $showCountryFlagsOrTemplating ? 'null' : EngineInterface::class,
__METHOD__,
Expand Down
2 changes: 1 addition & 1 deletion src/Checker/TranslatableChecker.php
Expand Up @@ -19,7 +19,7 @@
use Sonata\TranslationBundle\Traits\TranslatableTrait;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien@prestaconcept.net>
*/
Expand Down
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\DependencyInjection\Reference;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien@prestaconcept.net>
*/
Expand Down
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/SonataTranslationExtension.php
Expand Up @@ -23,7 +23,7 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/LocaleSwitcherListener.php
Expand Up @@ -17,7 +17,7 @@
use Sonata\BlockBundle\Model\Block;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/SonataTranslationBundle.php
Expand Up @@ -19,7 +19,7 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Test/DoctrineOrmTestCase.php
Expand Up @@ -27,7 +27,7 @@
*
* NEXT_MAJOR: Remove this class.
*
* @deprecated since version 2.x, to be removed in 3.0. It has been moved to Tests namespace.
* @deprecated since version 2.7, to be removed in 3.0. It has been moved to Tests namespace.
*
* @author Dariusz Markowicz <dmarkowicz77@gmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/Extension/SonataTranslationExtension.php
Expand Up @@ -20,7 +20,7 @@
use Twig\TwigTest;

/**
* @final since sonata-project/translation-bundle 2.x
* @final since sonata-project/translation-bundle 2.7
*
* @author Nicolas Bastien <nbastien.pro@gmail.com>
*/
Expand Down
Expand Up @@ -91,7 +91,7 @@ public function testGetTranslatableLocaleFromContainer(): void
->method('getConfigurationPool')
->willReturn($pool);

$this->expectDeprecation('Omitting the argument 2 or passing other type than "string" to "Sonata\TranslationBundle\Admin\Extension\AbstractTranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.x and will be not possible in version 3.0.');
$this->expectDeprecation('Omitting the argument 2 or passing other type than "string" to "Sonata\TranslationBundle\Admin\Extension\AbstractTranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.7 and will be not possible in version 3.0.');

$extension = new class($this->translatableChecker) extends AbstractTranslatableAdminExtension {
};
Expand Down
Expand Up @@ -66,9 +66,9 @@ protected function setUp(): void
TranslatableInterface::class,
]);

$this->expectDeprecation('Omitting the argument 2 or passing other type than "string" to "Sonata\TranslationBundle\Admin\Extension\AbstractTranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.x and will be not possible in version 3.0.');
$this->expectDeprecation('Not passing an instance of "Gedmo\Translatable\TranslatableListener" as argument 2 to "Sonata\TranslationBundle\Admin\Extension\Gedmo\TranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.x and will be mandatory in 3.0.');
$this->expectDeprecation('Not passing an instance of "Doctrine\Persistence\ManagerRegistry" as argument 3 to "Sonata\TranslationBundle\Admin\Extension\Gedmo\TranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.x and will be mandatory in 3.0.');
$this->expectDeprecation('Omitting the argument 2 or passing other type than "string" to "Sonata\TranslationBundle\Admin\Extension\AbstractTranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.7 and will be not possible in version 3.0.');
$this->expectDeprecation('Not passing an instance of "Gedmo\Translatable\TranslatableListener" as argument 2 to "Sonata\TranslationBundle\Admin\Extension\Gedmo\TranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.7 and will be mandatory in 3.0.');
$this->expectDeprecation('Not passing an instance of "Doctrine\Persistence\ManagerRegistry" as argument 3 to "Sonata\TranslationBundle\Admin\Extension\Gedmo\TranslatableAdminExtension::__construct()" is deprecated since sonata-project/translation-bundle 2.7 and will be mandatory in 3.0.');

$this->extension = new TranslatableAdminExtension(
$translatableChecker
Expand Down
2 changes: 1 addition & 1 deletion tests/Block/LocaleSwitcherBlockServiceTest.php
Expand Up @@ -64,7 +64,7 @@ public function testDefaultSettingsWithDeprecatedConstructor(): void
$showCountryFlags = true;
$this->expectDeprecation(
'Passing "null" as argument 2 to "Sonata\TranslationBundle\Block\LocaleSwitcherBlockService::__construct()"'
.' is deprecated since sonata-project/translation-bundle 2.x and will throw a "TypeError" error in version 3.0.'
.' is deprecated since sonata-project/translation-bundle 2.7 and will throw a "TypeError" error in version 3.0.'
.' You must pass a "bool" value instead.'
);
$localeSwitcherBlock = new LocaleSwitcherBlockService($environment, null, $showCountryFlags);
Expand Down

0 comments on commit fd87722

Please sign in to comment.