Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
Merge 185a405 into 65a57fe
Browse files Browse the repository at this point in the history
  • Loading branch information
wbloszyk committed May 22, 2020
2 parents 65a57fe + 185a405 commit 7f64934
Show file tree
Hide file tree
Showing 129 changed files with 3,184 additions and 323 deletions.
20 changes: 11 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
],
"require": {
"php": "^7.2",
"cocur/slugify": "^1.4 || ^2.0 || ^3.0 || ^4.0",
"sonata-project/doctrine-extensions": "^1.1",
"cocur/slugify": "^3.0 || ^4.0",
"sonata-project/doctrine-extensions": "^1.5",
"symfony/config": "^4.3",
"symfony/dependency-injection": "^4.3",
"symfony/event-dispatcher": "^4.3",
Expand All @@ -35,21 +35,23 @@
"symfony/twig-bridge": "^4.3",
"symfony/validator": "^4.3",
"twig/extensions": "^1.5",
"twig/twig": "^1.34 || ^2.0"
"twig/twig": "^2.12.1"
},
"conflict": {
"sonata-project/exporter": "< 1.11.0"
"sonata-project/exporter": "< 1.11"
},
"require-dev": {
"doctrine/orm": "^2.4",
"doctrine/phpcr-odm": "^1.0",
"jackalope/jackalope-doctrine-dbal": "^1.0",
"jms/serializer-bundle": "^1.0 || ^2.0",
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"jms/serializer-bundle": "^2.0",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"nelmio/api-doc-bundle": "^2.11",
"sonata-project/exporter": "^1.11.0 || ^2.0",
"symfony/phpunit-bridge": "^4.3"
"phpspec/prophecy": "^1.10.3",
"sonata-project/exporter": "^1.11 || ^2.0",
"symfony/browser-kit": "^3.4 || ^4.3 || ^5.0",
"symfony/phpunit-bridge": "^5.0"
},
"suggest": {
"sonata-project/doctrine-extensions": "Direct replacement for Doctrine behavioral extensions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

/**
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
class AdapterCompilerPass implements CompilerPassInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

/**
* @author Hugo Briand <briand@ekino.com>
*
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
class StatusRendererCompilerPass implements CompilerPassInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/CoreBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
* @author Alexander <iam.asm89@gmail.com>
*
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
class Configuration implements ConfigurationInterface
{
Expand Down
29 changes: 17 additions & 12 deletions src/CoreBundle/DependencyInjection/SonataCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

/**
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
class SonataCoreExtension extends Extension implements PrependExtensionInterface
{
Expand Down Expand Up @@ -90,14 +92,25 @@ public function load(array $configs, ContainerBuilder $container)
}

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('commands.xml');
$loader->load('core.xml');
$loader->load('date.xml');
$loader->load('flash.xml');
$loader->load('form_types.xml');
$loader->load('validator.xml');
$loader->load('twig.xml');
$loader->load('model_adapter.xml');
$loader->load('core.xml');
$loader->load('commands.xml');
$loader->load('twig.xml');
$loader->load('validator.xml');

if (!isset($bundles['SonataFormBundle'])) {
$loader->load('form/date.xml');
$loader->load('form/form_types.xml');
$loader->load('form/validator.xml');
}

if (!isset($bundles['SonataTwigBundle'])) {
$loader->load('twig/flash.xml');
$loader->load('twig/twig.xml');
}

$this->registerFlashTypes($container, $config);
$container->setParameter('sonata.core.form_type', $config['form_type']);
Expand All @@ -107,8 +120,6 @@ public function load(array $configs, ContainerBuilder $container)
$this->configureClassesToCompile();
}

$this->deprecateSlugify($container);

$this->configureSerializerFormats($config);
}

Expand Down Expand Up @@ -201,10 +212,4 @@ public function configureSerializerFormats($config)
BaseSerializerHandler::setFormats($config['serializer']['formats']);
}
}

protected function deprecateSlugify(ContainerBuilder $container)
{
$container->getDefinition('sonata.core.slugify.cocur')->setDeprecated(true);
$container->getDefinition('sonata.core.slugify.native')->setDeprecated(true);
}
}
2 changes: 2 additions & 0 deletions src/CoreBundle/Exporter/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

/**
* NEXT_MAJOR: remove this class, and the dev dependency.
*
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
class Exporter
{
Expand Down
44 changes: 13 additions & 31 deletions src/CoreBundle/Form/EventListener/FixCheckboxDataListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,24 @@

namespace Sonata\CoreBundle\Form\EventListener;

use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
if (!class_exists(\Sonata\Form\EventListener\FixCheckboxDataListener::class, false)) {
@trigger_error(
'The '.__NAMESPACE__.'\FixCheckboxDataListener class is deprecated since version 3.13.0 and will be removed in 4.0.'
.' Use Sonata\Form\EventListener\FixCheckboxDataListener instead.',
E_USER_DEPRECATED
);
}

@trigger_error(
'The '.__NAMESPACE__.'\FixCheckboxDataListener class is deprecated since version 3.13.0 and will be removed in 4.0.'
.' Use Sonata\Form\EventListener\FixCheckboxDataListener instead.',
E_USER_DEPRECATED
class_alias(
\Sonata\Form\EventListener\FixCheckboxDataListener::class,
__NAMESPACE__.'\FixCheckboxDataListener'
);

/**
* @deprecated since sonata-project/core-bundle 3.13.0, to be removed in 4.0.
*/
class FixCheckboxDataListener extends \Sonata\Form\EventListener\FixCheckboxDataListener
{
public static function getSubscribedEvents()
{
return [FormEvents::PRE_SUBMIT => 'preBind'];
}

if (false) {
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/core-bundle 2.3, to be renamed in 4.0.
* Use {@link preSubmit} instead
* @deprecated since sonata-project/core-bundle 3.13.0, to be removed in 4.0.
*/
public function preBind(FormEvent $event)
class FixCheckboxDataListener extends \Sonata\Form\EventListener\FixCheckboxDataListener
{
// BC prevention for class extending this one.
if (self::class !== static::class) {
@trigger_error(
__METHOD__.' is deprecated since 2.3 and will be renamed in 4.0.'
.' Use '.__CLASS__.'::preSubmit instead.',
E_USER_DEPRECATED
);
}

$this->preSubmit($event);
}
}
68 changes: 13 additions & 55 deletions src/CoreBundle/Form/EventListener/ResizeFormListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,24 @@

namespace Sonata\CoreBundle\Form\EventListener;

use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
if (!class_exists(\Sonata\Form\EventListener\ResizeFormListener::class, false)) {
@trigger_error(
'The '.__NAMESPACE__.'\ResizeFormListener class is deprecated since version 3.13.0 and will be removed in 4.0.'
.' Use Sonata\Form\EventListener\ResizeFormListener instead.',
E_USER_DEPRECATED
);
}

@trigger_error(
'The '.__NAMESPACE__.'\ResizeFormListener class is deprecated since version 3.13.0 and will be removed in 4.0.'
.' Use Sonata\Form\EventListener\ResizeFormListener instead.',
E_USER_DEPRECATED
class_alias(
\Sonata\Form\EventListener\ResizeFormListener::class,
__NAMESPACE__.'\ResizeFormListener'
);

/**
* @deprecated since sonata-project/core-bundle 3.13.0, to be removed in 4.0.
*/
class ResizeFormListener extends \Sonata\Form\EventListener\ResizeFormListener
{
public static function getSubscribedEvents()
{
return [
FormEvents::PRE_SET_DATA => 'preSetData',
FormEvents::PRE_SUBMIT => 'preBind',
FormEvents::SUBMIT => 'onBind',
];
}

/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/core-bundle 2.3, to be renamed in 4.0.
* Use {@link preSubmit} instead
*/
public function preBind(FormEvent $event)
{
// BC prevention for class extending this one.
if (self::class !== static::class) {
@trigger_error(
__METHOD__.' method is deprecated since 2.3 and will be renamed in 4.0.'
.' Use '.__CLASS__.'::preSubmit instead.',
E_USER_DEPRECATED
);
}

$this->preSubmit($event);
}

if (false) {
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/core-bundle 2.3, to be removed in 4.0.
* Use {@link onSubmit} instead
* @deprecated since sonata-project/core-bundle 3.13.0, to be removed in 4.0.
*/
public function onBind(FormEvent $event)
class ResizeFormListener extends \Sonata\Form\EventListener\ResizeFormListener
{
// BC prevention for class extending this one.
if (self::class !== static::class) {
@trigger_error(
__METHOD__.' is deprecated since 2.3 and will be renamed in 4.0.'
.' Use '.__CLASS__.'::onSubmit instead.',
E_USER_DEPRECATED
);
}

$this->onSubmit($event);
}
}
3 changes: 3 additions & 0 deletions src/CoreBundle/Form/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
class FormHelper
{
private static $typeMapping = [];
Expand Down
11 changes: 0 additions & 11 deletions src/CoreBundle/Form/Type/ColorSelectorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* NEXT_MAJOR: remove this class.
Expand All @@ -38,16 +37,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
parent::buildForm($builder, $options);
}

/**
* {@inheritdoc}
*
* @todo Remove it when bumping requirements to SF 2.7+
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
Expand Down
11 changes: 0 additions & 11 deletions src/CoreBundle/Form/Type/TranslatableChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Translation\TranslatorInterface;

/**
Expand All @@ -40,16 +39,6 @@ public function __construct(TranslatorInterface $translator)
$this->translator = $translator;
}

/**
* {@inheritdoc}
*
* @todo Remove it when bumping requirements to SF 2.7+
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
Expand Down
3 changes: 3 additions & 0 deletions src/CoreBundle/Model/PageableManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class_alias(
);

if (false) {
/**
* @deprecated since sonata-project/core-bundle 3.x, to be removed in 4.0.
*/
interface PageableManagerInterface extends \Sonata\Doctrine\Model\PageableManagerInterface
{
}
Expand Down
2 changes: 2 additions & 0 deletions src/CoreBundle/Resources/config/commands.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="Sonata\CoreBundle\Command\SonataDumpDoctrineMetaCommand" class="Sonata\CoreBundle\Command\SonataDumpDoctrineMetaCommand">
<deprecated>The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0.</deprecated>
<tag name="console.command"/>
</service>
<service id="Sonata\CoreBundle\Command\SonataListFormMappingCommand" class="Sonata\CoreBundle\Command\SonataListFormMappingCommand">
<deprecated>The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0.</deprecated>
<tag name="console.command"/>
</service>
</services>
Expand Down
5 changes: 4 additions & 1 deletion src/CoreBundle/Resources/config/core.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sonata.core.slugify.cocur" class="Cocur\Slugify\Slugify" public="true"/>
<service id="sonata.core.slugify.cocur" class="Cocur\Slugify\Slugify" public="true">
<deprecated>The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.twig.slugify.cocur" instead.</deprecated>
</service>
<service id="sonata.core.slugify.native" class="Sonata\CoreBundle\Component\NativeSlugify" public="true">
<deprecated>The "%service_id%" service is deprecated since 2.3 and will be removed in 4.0.</deprecated>
</service>
<service id="sonata.core.form.extension.dependency" class="Sonata\CoreBundle\Form\Extension\DependencyInjectionExtension">
<deprecated>The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0.</deprecated>
<argument type="service" id="service_container"/>
<argument type="collection"/>
<argument type="collection"/>
Expand Down
4 changes: 3 additions & 1 deletion src/CoreBundle/Resources/config/date.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sonata.core.date.moment_format_converter" class="Sonata\Form\Date\MomentFormatConverter"/>
<service id="sonata.core.date.moment_format_converter" alias="sonata.form.date.moment_format_converter">
<deprecated>The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "%alias_id%" instead.</deprecated>
</service>
</services>
</container>
4 changes: 3 additions & 1 deletion src/CoreBundle/Resources/config/exporter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!-- NEXT_MAJOR : remove this file -->
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sonata.core.exporter" class="Sonata\CoreBundle\Exporter\Exporter"/>
<service id="sonata.core.exporter" class="Sonata\CoreBundle\Exporter\Exporter">
<deprecated>The "%service_id%" service is deprecated since sonata-project/core-bundle 3.x and will be removed in 4.0. Use "sonata.exporter.exporter" instead.</deprecated>
</service>
</services>
</container>

0 comments on commit 7f64934

Please sign in to comment.