Skip to content

Commit b8de1a8

Browse files
Merge branch '5.1' into 5.2
* 5.1: Update .php_cs.dist Apply "visibility_required" CS rule to constants
2 parents dd053aa + 82fbd72 commit b8de1a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+69
-69
lines changed

AbstractRendererEngine.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class AbstractRendererEngine implements FormRendererEngineInterface
2121
/**
2222
* The variable in {@link FormView} used as cache key.
2323
*/
24-
const CACHE_KEY_VAR = 'cache_key';
24+
public const CACHE_KEY_VAR = 'cache_key';
2525

2626
protected $defaultThemes;
2727
protected $themes = [];

Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
*/
2323
class DateIntervalToArrayTransformer implements DataTransformerInterface
2424
{
25-
const YEARS = 'years';
26-
const MONTHS = 'months';
27-
const DAYS = 'days';
28-
const HOURS = 'hours';
29-
const MINUTES = 'minutes';
30-
const SECONDS = 'seconds';
31-
const INVERT = 'invert';
25+
public const YEARS = 'years';
26+
public const MONTHS = 'months';
27+
public const DAYS = 'days';
28+
public const HOURS = 'hours';
29+
public const MINUTES = 'minutes';
30+
public const SECONDS = 'seconds';
31+
public const INVERT = 'invert';
3232

3333
private static $availableFields = [
3434
self::YEARS => 'y',

Extension/Core/DataTransformer/DateTimeToHtml5LocalDateTimeTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class DateTimeToHtml5LocalDateTimeTransformer extends BaseDateTimeTransformer
2222
{
23-
const HTML5_FORMAT = 'Y-m-d\\TH:i:s';
23+
public const HTML5_FORMAT = 'Y-m-d\\TH:i:s';
2424

2525
/**
2626
* Transforms a \DateTime into a local date and time string.

Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,37 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface
2626
/**
2727
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_CEILING instead.
2828
*/
29-
const ROUND_CEILING = \NumberFormatter::ROUND_CEILING;
29+
public const ROUND_CEILING = \NumberFormatter::ROUND_CEILING;
3030

3131
/**
3232
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_FLOOR instead.
3333
*/
34-
const ROUND_FLOOR = \NumberFormatter::ROUND_FLOOR;
34+
public const ROUND_FLOOR = \NumberFormatter::ROUND_FLOOR;
3535

3636
/**
3737
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_UP instead.
3838
*/
39-
const ROUND_UP = \NumberFormatter::ROUND_UP;
39+
public const ROUND_UP = \NumberFormatter::ROUND_UP;
4040

4141
/**
4242
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_DOWN instead.
4343
*/
44-
const ROUND_DOWN = \NumberFormatter::ROUND_DOWN;
44+
public const ROUND_DOWN = \NumberFormatter::ROUND_DOWN;
4545

4646
/**
4747
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_HALFEVEN instead.
4848
*/
49-
const ROUND_HALF_EVEN = \NumberFormatter::ROUND_HALFEVEN;
49+
public const ROUND_HALF_EVEN = \NumberFormatter::ROUND_HALFEVEN;
5050

5151
/**
5252
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_HALFUP instead.
5353
*/
54-
const ROUND_HALF_UP = \NumberFormatter::ROUND_HALFUP;
54+
public const ROUND_HALF_UP = \NumberFormatter::ROUND_HALFUP;
5555

5656
/**
5757
* @deprecated since Symfony 5.1, use \NumberFormatter::ROUND_HALFDOWN instead.
5858
*/
59-
const ROUND_HALF_DOWN = \NumberFormatter::ROUND_HALFDOWN;
59+
public const ROUND_HALF_DOWN = \NumberFormatter::ROUND_HALFDOWN;
6060

6161
protected $grouping;
6262

Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*/
2424
class PercentToLocalizedStringTransformer implements DataTransformerInterface
2525
{
26-
const FRACTIONAL = 'fractional';
27-
const INTEGER = 'integer';
26+
public const FRACTIONAL = 'fractional';
27+
public const INTEGER = 'integer';
2828

2929
protected static $types = [
3030
self::FRACTIONAL,

Extension/Core/Type/DateTimeType.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131

3232
class DateTimeType extends AbstractType
3333
{
34-
const DEFAULT_DATE_FORMAT = \IntlDateFormatter::MEDIUM;
35-
const DEFAULT_TIME_FORMAT = \IntlDateFormatter::MEDIUM;
34+
public const DEFAULT_DATE_FORMAT = \IntlDateFormatter::MEDIUM;
35+
public const DEFAULT_TIME_FORMAT = \IntlDateFormatter::MEDIUM;
3636

3737
/**
3838
* The HTML5 datetime-local format as defined in
3939
* http://w3c.github.io/html-reference/datatypes.html#form.data.datetime-local.
4040
*/
41-
const HTML5_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
41+
public const HTML5_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
4242

4343
private static $acceptedFormats = [
4444
\IntlDateFormatter::FULL,

Extension/Core/Type/DateType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
class DateType extends AbstractType
3030
{
31-
const DEFAULT_FORMAT = \IntlDateFormatter::MEDIUM;
32-
const HTML5_FORMAT = 'yyyy-MM-dd';
31+
public const DEFAULT_FORMAT = \IntlDateFormatter::MEDIUM;
32+
public const HTML5_FORMAT = 'yyyy-MM-dd';
3333

3434
private static $acceptedFormats = [
3535
\IntlDateFormatter::FULL,

Extension/Core/Type/FileType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
class FileType extends AbstractType
2626
{
27-
const KIB_BYTES = 1024;
28-
const MIB_BYTES = 1048576;
27+
public const KIB_BYTES = 1024;
28+
public const MIB_BYTES = 1048576;
2929

3030
private static $suffixes = [
3131
1 => 'bytes',

Extension/Validator/Constraints/Form.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919
class Form extends Constraint
2020
{
21-
const NOT_SYNCHRONIZED_ERROR = '1dafa156-89e1-4736-b832-419c2e501fca';
22-
const NO_SUCH_FIELD_ERROR = '6e5212ed-a197-4339-99aa-5654798a4854';
21+
public const NOT_SYNCHRONIZED_ERROR = '1dafa156-89e1-4736-b832-419c2e501fca';
22+
public const NO_SUCH_FIELD_ERROR = '6e5212ed-a197-4339-99aa-5654798a4854';
2323

2424
protected static $errorNames = [
2525
self::NOT_SYNCHRONIZED_ERROR => 'NOT_SYNCHRONIZED_ERROR',

FormErrorIterator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \Array
3333
/**
3434
* The prefix used for indenting nested error messages.
3535
*/
36-
const INDENTATION = ' ';
36+
public const INDENTATION = ' ';
3737

3838
private $form;
3939
private $errors;

FormEvents.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class FormEvents
3737
*
3838
* @Event("Symfony\Component\Form\Event\PreSubmitEvent")
3939
*/
40-
const PRE_SUBMIT = 'form.pre_submit';
40+
public const PRE_SUBMIT = 'form.pre_submit';
4141

4242
/**
4343
* The SUBMIT event is dispatched after the Form::submit() method
@@ -56,7 +56,7 @@ final class FormEvents
5656
*
5757
* @Event("Symfony\Component\Form\Event\SubmitEvent")
5858
*/
59-
const SUBMIT = 'form.submit';
59+
public const SUBMIT = 'form.submit';
6060

6161
/**
6262
* The FormEvents::POST_SUBMIT event is dispatched at the very end of the Form::submit().
@@ -71,7 +71,7 @@ final class FormEvents
7171
*
7272
* @Event("Symfony\Component\Form\Event\PostSubmitEvent")
7373
*/
74-
const POST_SUBMIT = 'form.post_submit';
74+
public const POST_SUBMIT = 'form.post_submit';
7575

7676
/**
7777
* The FormEvents::PRE_SET_DATA event is dispatched at the beginning of the Form::setData() method.
@@ -82,7 +82,7 @@ final class FormEvents
8282
*
8383
* @Event("Symfony\Component\Form\Event\PreSetDataEvent")
8484
*/
85-
const PRE_SET_DATA = 'form.pre_set_data';
85+
public const PRE_SET_DATA = 'form.pre_set_data';
8686

8787
/**
8888
* The FormEvents::POST_SET_DATA event is dispatched at the end of the Form::setData() method.
@@ -92,14 +92,14 @@ final class FormEvents
9292
*
9393
* @Event("Symfony\Component\Form\Event\PostSetDataEvent")
9494
*/
95-
const POST_SET_DATA = 'form.post_set_data';
95+
public const POST_SET_DATA = 'form.post_set_data';
9696

9797
/**
9898
* Event aliases.
9999
*
100100
* These aliases can be consumed by RegisterListenersPass.
101101
*/
102-
const ALIASES = [
102+
public const ALIASES = [
103103
PreSubmitEvent::class => self::PRE_SUBMIT,
104104
SubmitEvent::class => self::SUBMIT,
105105
PostSubmitEvent::class => self::POST_SUBMIT,

FormRenderer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class FormRenderer implements FormRendererInterface
2525
{
26-
const CACHE_KEY_VAR = 'unique_block_prefix';
26+
public const CACHE_KEY_VAR = 'unique_block_prefix';
2727

2828
private $engine;
2929
private $csrfTokenManager;

Guess/Guess.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ abstract class Guess
2727
/**
2828
* Marks an instance with a value that is extremely likely to be correct.
2929
*/
30-
const VERY_HIGH_CONFIDENCE = 3;
30+
public const VERY_HIGH_CONFIDENCE = 3;
3131

3232
/**
3333
* Marks an instance with a value that is very likely to be correct.
3434
*/
35-
const HIGH_CONFIDENCE = 2;
35+
public const HIGH_CONFIDENCE = 2;
3636

3737
/**
3838
* Marks an instance with a value that is likely to be correct.
3939
*/
40-
const MEDIUM_CONFIDENCE = 1;
40+
public const MEDIUM_CONFIDENCE = 1;
4141

4242
/**
4343
* Marks an instance with a value that may be correct.
4444
*/
45-
const LOW_CONFIDENCE = 0;
45+
public const LOW_CONFIDENCE = 0;
4646

4747
/**
4848
* The confidence about the correctness of the value.

Tests/Extension/Core/Type/BaseTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class BaseTypeTest extends TypeTestCase
2121
{
2222
use VersionAwareTest;
2323

24-
const TESTED_TYPE = '';
24+
public const TESTED_TYPE = '';
2525

2626
public function testPassDisabledAsOption()
2727
{

Tests/Extension/Core/Type/BirthdayTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class BirthdayTypeTest extends DateTypeTest
1818
{
19-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\BirthdayType';
19+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\BirthdayType';
2020

2121
public function testSetInvalidYearsOption()
2222
{

Tests/Extension/Core/Type/ButtonTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class ButtonTypeTest extends BaseTypeTest
1818
{
19-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\ButtonType';
19+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\ButtonType';
2020

2121
public function testCreateButtonInstances()
2222
{

Tests/Extension/Core/Type/CheckboxTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class CheckboxTypeTest extends BaseTypeTest
1717
{
18-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CheckboxType';
18+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CheckboxType';
1919

2020
public function testDataIsFalseByDefault()
2121
{

Tests/Extension/Core/Type/ChoiceTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ChoiceTypeTest extends BaseTypeTest
2222
{
2323
use ExpectDeprecationTrait;
2424

25-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
25+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\ChoiceType';
2626

2727
private $choices = [
2828
'Bernhard' => 'a',

Tests/Extension/Core/Type/CollectionTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class CollectionTypeTest extends BaseTypeTest
1919
{
20-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CollectionType';
20+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CollectionType';
2121

2222
public function testContainsNoChildByDefault()
2323
{

Tests/Extension/Core/Type/ColorTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
final class ColorTypeTest extends BaseTypeTest
1818
{
19-
const TESTED_TYPE = ColorType::class;
19+
public const TESTED_TYPE = ColorType::class;
2020

2121
/**
2222
* @dataProvider validationShouldPassProvider

Tests/Extension/Core/Type/CountryTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class CountryTypeTest extends BaseTypeTest
1818
{
19-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CountryType';
19+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CountryType';
2020

2121
protected function setUp(): void
2222
{

Tests/Extension/Core/Type/CurrencyTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class CurrencyTypeTest extends BaseTypeTest
1818
{
19-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CurrencyType';
19+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CurrencyType';
2020

2121
protected function setUp(): void
2222
{

Tests/Extension/Core/Type/DateIntervalTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class DateIntervalTypeTest extends BaseTypeTest
1919
{
20-
const TESTED_TYPE = DateIntervalType::class;
20+
public const TESTED_TYPE = DateIntervalType::class;
2121

2222
public function testSubmitDateInterval()
2323
{

Tests/Extension/Core/Type/DateTimeTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class DateTimeTypeTest extends BaseTypeTest
1818
{
19-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\DateTimeType';
19+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\DateTimeType';
2020

2121
protected function setUp(): void
2222
{

Tests/Extension/Core/Type/DateTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class DateTypeTest extends BaseTypeTest
2020
{
21-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\DateType';
21+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\DateType';
2222

2323
private $defaultTimezone;
2424
private $defaultLocale;

Tests/Extension/Core/Type/FileTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class FileTypeTest extends BaseTypeTest
2323
{
24-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\FileType';
24+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\FileType';
2525

2626
protected function getExtensions()
2727
{

Tests/Extension/Core/Type/FormTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function setReferenceCopy($reference)
5959

6060
class FormTypeTest extends BaseTypeTest
6161
{
62-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\FormType';
62+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\FormType';
6363

6464
public function testCreateFormInstances()
6565
{

Tests/Extension/Core/Type/IntegerTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class IntegerTypeTest extends BaseTypeTest
1717
{
18-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\IntegerType';
18+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\IntegerType';
1919

2020
protected function setUp(): void
2121
{

Tests/Extension/Core/Type/LanguageTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class LanguageTypeTest extends BaseTypeTest
1919
{
20-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\LanguageType';
20+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\LanguageType';
2121

2222
protected function setUp(): void
2323
{

Tests/Extension/Core/Type/LocaleTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class LocaleTypeTest extends BaseTypeTest
1818
{
19-
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\LocaleType';
19+
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\LocaleType';
2020

2121
protected function setUp(): void
2222
{

0 commit comments

Comments
 (0)