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

Commit

Permalink
Merge 193c246 into bd7a5f7
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 19, 2018
2 parents bd7a5f7 + 193c246 commit f15ade0
Show file tree
Hide file tree
Showing 18 changed files with 132 additions and 109 deletions.
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/BooleanType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\BooleanType::class,
__NAMESPACE__.'\BooleanType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class BooleanType extends \Sonata\Form\Type\BooleanType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class BooleanType extends \Sonata\Form\Type\BooleanType
{
public function getName()
{
return 'sonata_type_boolean_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/CollectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\CollectionType::class,
__NAMESPACE__.'\CollectionType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class CollectionType extends \Sonata\Form\Type\CollectionType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class CollectionType extends \Sonata\Form\Type\CollectionType
{
public function getName()
{
return 'sonata_type_collection_legacy';
}
}
4 changes: 4 additions & 0 deletions src/CoreBundle/Form/Type/DatePickerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class DatePickerType extends \Sonata\Form\Type\DatePickerType
{
public function getName()
{
return 'sonata_type_date_picker_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/DateRangePickerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\DateRangePickerType::class,
__NAMESPACE__.'\DateRangePickerType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateRangePickerType extends \Sonata\Form\Type\DateRangePickerType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateRangePickerType extends \Sonata\Form\Type\DateRangePickerType
{
public function getName()
{
return 'sonata_type_date_range_picker_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/DateRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\DateRangeType::class,
__NAMESPACE__.'\DateRangeType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateRangeType extends \Sonata\Form\Type\DateRangeType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateRangeType extends \Sonata\Form\Type\DateRangeType
{
public function getName()
{
return 'sonata_type_date_range_legacy';
}
}
4 changes: 4 additions & 0 deletions src/CoreBundle/Form/Type/DateTimePickerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class DateTimePickerType extends \Sonata\Form\Type\DateTimePickerType
{
public function getName()
{
return 'sonata_type_datetime_picker_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/DateTimeRangePickerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\DateTimeRangePickerType::class,
__NAMESPACE__.'\DateTimeRangePickerType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateTimeRangePickerType extends \Sonata\Form\Type\DateTimeRangePickerType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateTimeRangePickerType extends \Sonata\Form\Type\DateTimeRangePickerType
{
public function getName()
{
return 'sonata_type_datetime_range_picker_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/DateTimeRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\DateTimeRangeType::class,
__NAMESPACE__.'\DateTimeRangeType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateTimeRangeType extends \Sonata\Form\Type\DateTimeRangeType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class DateTimeRangeType extends \Sonata\Form\Type\DateTimeRangeType
{
public function getName()
{
return 'sonata_type_datetime_range_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/EqualType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\EqualType::class,
__NAMESPACE__.'\EqualType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class EqualType extends \Sonata\Form\Type\EqualType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class EqualType extends \Sonata\Form\Type\EqualType
{
public function getName()
{
return 'sonata_type_equal_legacy';
}
}
17 changes: 7 additions & 10 deletions src/CoreBundle/Form/Type/ImmutableArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
);
}

class_alias(
\Sonata\Form\Type\ImmutableArrayType::class,
__NAMESPACE__.'\ImmutableArrayType'
);

if (false) {
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class ImmutableArrayType extends \Sonata\Form\Type\ImmutableArrayType
/**
* @deprecated Since version 3.x, to be removed in 4.0.
*/
class ImmutableArrayType extends \Sonata\Form\Type\ImmutableArrayType
{
public function getName()
{
return 'sonata_type_immutable_array_legacy';
}
}
79 changes: 59 additions & 20 deletions src/CoreBundle/Resources/config/form_types.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,95 @@
<?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.form.type.array" class="Sonata\CoreBundle\Form\Type\ImmutableArrayType" public="true">
<tag name="form.type" alias="sonata_type_immutable_array"/>
<service id="sonata.core.form.type.array_legacy" class="Sonata\CoreBundle\Form\Type\ImmutableArrayType" public="true">
<tag name="form.type" alias="sonata_type_immutable_array_legacy"/>
</service>
<service id="sonata.core.form.type.boolean" class="Sonata\CoreBundle\Form\Type\BooleanType" public="true">
<tag name="form.type" alias="sonata_type_boolean"/>
<service id="sonata.core.form.type.boolean_legacy" class="Sonata\CoreBundle\Form\Type\BooleanType" public="true">
<tag name="form.type" alias="sonata_type_boolean_legacy"/>
</service>
<service id="sonata.core.form.type.collection" class="Sonata\CoreBundle\Form\Type\CollectionType" public="true">
<tag name="form.type" alias="sonata_type_collection"/>
<service id="sonata.core.form.type.collection_legacy" class="Sonata\CoreBundle\Form\Type\CollectionType" public="true">
<tag name="form.type" alias="sonata_type_collection_legacy"/>
</service>
<service id="sonata.core.form.type.translatable_choice" class="Sonata\CoreBundle\Form\Type\TranslatableChoiceType" public="true">
<deprecated>The "%service_id%" service is deprecated since 2.2.0 and will be removed in 4.0.</deprecated>
<tag name="form.type" alias="sonata_type_translatable_choice"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.date_range" class="Sonata\CoreBundle\Form\Type\DateRangeType" public="true">
<service id="sonata.core.form.type.date_range_legacy" class="Sonata\CoreBundle\Form\Type\DateRangeType" public="true">
<tag name="form.type" alias="sonata_type_date_range_legacy"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.datetime_range_legacy" class="Sonata\CoreBundle\Form\Type\DateTimeRangeType" public="true">
<tag name="form.type" alias="sonata_type_datetime_range_legacy"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.date_picker_legacy" class="Sonata\CoreBundle\Form\Type\DatePickerType" public="true">
<tag name="form.type" alias="sonata_type_date_picker_legacy"/>
<argument type="service" id="sonata.core.date.moment_format_converter"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.datetime_picker_legacy" class="Sonata\CoreBundle\Form\Type\DateTimePickerType" public="true">
<tag name="form.type" alias="sonata_type_datetime_picker_legacy"/>
<argument type="service" id="sonata.core.date.moment_format_converter"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.date_range_picker_legacy" class="Sonata\CoreBundle\Form\Type\DateRangePickerType" public="true">
<tag name="form.type" alias="sonata_type_date_range_picker_legacy"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.datetime_range_picker_legacy" class="Sonata\CoreBundle\Form\Type\DateTimeRangePickerType" public="true">
<tag name="form.type" alias="sonata_type_datetime_range_picker_legacy"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.equal_legacy" class="Sonata\CoreBundle\Form\Type\EqualType" public="true">
<tag name="form.type" alias="sonata_type_equal_legacy"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.color_selector" class="Sonata\CoreBundle\Form\Type\ColorSelectorType" public="true">
<deprecated>The "%service_id%" service is deprecated since 3.5 and will be removed in 4.0.</deprecated>
<tag name="form.type" alias="sonata_type_color_selector"/>
</service>
<service id="sonata.core.form.type.color_legacy" class="Sonata\CoreBundle\Form\Type\ColorType" public="true">
<tag name="form.type" alias="sonata_type_color"/>
</service>
<service id="sonata.core.form.type.array" class="Sonata\Form\ImmutableArrayType" public="true">
<tag name="form.type" alias="sonata_type_immutable_array"/>
</service>
<service id="sonata.core.form.type.boolean" class="Sonata\Form\BooleanType" public="true">
<tag name="form.type" alias="sonata_type_boolean"/>
</service>
<service id="sonata.core.form.type.collection" class="Sonata\Form\CollectionType" public="true">
<tag name="form.type" alias="sonata_type_collection"/>
</service>
<service id="sonata.core.form.type.date_range" class="Sonata\Form\DateRangeType" public="true">
<tag name="form.type" alias="sonata_type_date_range"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.datetime_range" class="Sonata\CoreBundle\Form\Type\DateTimeRangeType" public="true">
<service id="sonata.core.form.type.datetime_range" class="Sonata\Form\DateTimeRangeType" public="true">
<tag name="form.type" alias="sonata_type_datetime_range"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.date_picker" class="Sonata\CoreBundle\Form\Type\DatePickerType" public="true">
<service id="sonata.core.form.type.date_picker" class="Sonata\Form\DatePickerType" public="true">
<tag name="form.type" alias="sonata_type_date_picker"/>
<argument type="service" id="sonata.core.date.moment_format_converter"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.datetime_picker" class="Sonata\CoreBundle\Form\Type\DateTimePickerType" public="true">
<service id="sonata.core.form.type.datetime_picker" class="Sonata\Form\DateTimePickerType" public="true">
<tag name="form.type" alias="sonata_type_datetime_picker"/>
<argument type="service" id="sonata.core.date.moment_format_converter"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.date_range_picker" class="Sonata\CoreBundle\Form\Type\DateRangePickerType" public="true">
<service id="sonata.core.form.type.date_range_picker" class="Sonata\Form\DateRangePickerType" public="true">
<tag name="form.type" alias="sonata_type_date_range_picker"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.datetime_range_picker" class="Sonata\CoreBundle\Form\Type\DateTimeRangePickerType" public="true">
<service id="sonata.core.form.type.datetime_range_picker" class="Sonata\Form\DateTimeRangePickerType" public="true">
<tag name="form.type" alias="sonata_type_datetime_range_picker"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.equal" class="Sonata\CoreBundle\Form\Type\EqualType" public="true">
<service id="sonata.core.form.type.equal" class="Sonata\Form\EqualType" public="true">
<tag name="form.type" alias="sonata_type_equal"/>
<argument type="service" id="translator"/>
</service>
<service id="sonata.core.form.type.color_selector" class="Sonata\CoreBundle\Form\Type\ColorSelectorType" public="true">
<deprecated>The "%service_id%" service is deprecated since 3.5 and will be removed in 4.0.</deprecated>
<tag name="form.type" alias="sonata_type_color_selector"/>
</service>
<service id="sonata.core.form.type.color" class="Sonata\CoreBundle\Form\Type\ColorType" public="true">
<tag name="form.type" alias="sonata_type_color"/>
</service>
</services>
</container>
4 changes: 2 additions & 2 deletions tests/CoreBundle/Form/Type/DatePickerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testGetName()
{
$type = new DatePickerType(new MomentFormatConverter(), $this->createMock(TranslatorInterface::class));

$this->assertSame('sonata_type_date_picker', $type->getName());
$this->assertSame('sonata_type_date_picker_legacy', $type->getName());
}

/**
Expand All @@ -74,7 +74,7 @@ public function testConstructorLegacy()
{
$type = new DatePickerType(new MomentFormatConverter());

$this->assertSame('sonata_type_date_picker', $type->getName());
$this->assertSame('sonata_type_date_picker_legacy', $type->getName());
}

public function testSubmitValidData()
Expand Down
2 changes: 1 addition & 1 deletion tests/CoreBundle/Form/Type/DateRangePickerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGetDefaultOptions()
{
$type = new DateRangePickerType($this->createMock(TranslatorInterface::class));

$this->assertSame('sonata_type_date_range_picker', $type->getName());
$this->assertSame('sonata_type_date_range_picker_legacy', $type->getName());

FormHelper::configureOptions($type, $resolver = new OptionsResolver());

Expand Down
2 changes: 1 addition & 1 deletion tests/CoreBundle/Form/Type/DateRangeTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGetDefaultOptions()
{
$type = new DateRangeType($this->createMock(TranslatorInterface::class));

$this->assertSame('sonata_type_date_range', $type->getName());
$this->assertSame('sonata_type_date_range_legacy', $type->getName());

FormHelper::configureOptions($type, $resolver = new OptionsResolver());

Expand Down
4 changes: 2 additions & 2 deletions tests/CoreBundle/Form/Type/DateTimePickerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testGetName()
{
$type = new DateTimePickerType(new MomentFormatConverter(), $this->createMock(TranslatorInterface::class));

$this->assertSame('sonata_type_datetime_picker', $type->getName());
$this->assertSame('sonata_type_datetime_picker_legacy', $type->getName());
}

/**
Expand All @@ -78,7 +78,7 @@ public function testConstructorLegacy()
{
$type = new DateTimePickerType(new MomentFormatConverter());

$this->assertSame('sonata_type_datetime_picker', $type->getName());
$this->assertSame('sonata_type_datetime_picker_legacy', $type->getName());
}

public function testSubmitUnmatchingDateFormat()
Expand Down
2 changes: 1 addition & 1 deletion tests/CoreBundle/Form/Type/DateTimeRangePickerTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGetDefaultOptions()
{
$type = new DateTimeRangePickerType($this->createMock(TranslatorInterface::class));

$this->assertSame('sonata_type_datetime_range_picker', $type->getName());
$this->assertSame('sonata_type_datetime_range_picker_legacy', $type->getName());

FormHelper::configureOptions($type, $resolver = new OptionsResolver());

Expand Down
2 changes: 1 addition & 1 deletion tests/CoreBundle/Form/Type/EqualTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testGetDefaultOptions()

$type = new EqualType($mock);

$this->assertSame('sonata_type_equal', $type->getName());
$this->assertSame('sonata_type_equal_legacy', $type->getName());
$this->assertSame(ChoiceType::class, $type->getParent());

FormHelper::configureOptions($type, $resolver = new OptionsResolver());
Expand Down
Loading

0 comments on commit f15ade0

Please sign in to comment.