8000 Merge branch '5.1' into 5.2 · symfony/symfony@555697d · GitHub
[go: up one dir, main page]

Skip to content

Commit 555697d

Browse files
Merge branch '5.1' into 5.2
* 5.1: Update .php_cs.dist Apply "visibility_required" CS rule to constants
2 parents f37f56c + a8b992f commit 555697d

File tree

234 files changed

+871
-870
lines changed

Some content is hidden

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

234 files changed

+871
-870
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ return PhpCsFixer\Config::create()
1616
'native_constant_invocation' => true,
1717
'combine_nested_dirname' => true,
1818
'list_syntax' => ['syntax' => 'short'],
19+
'visibility_required' => ['property', 'method', 'const'],
1920
])
2021
->setRiskyAllowed(true)
2122
->setFinder(

src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
*/
2121
class DbalLogger implements SQLLogger
2222
{
23-
const MAX_STRING_LENGTH = 32;
24-
const BINARY_DATA_VALUE = '(binary value)';
23+
public const MAX_STRING_LENGTH = 32;
24+
public const BINARY_DATA_VALUE = '(binary value)';
2525

2626
protected $logger;
2727
protected $stopwatch;

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
class EntityTypeTest extends BaseTypeTest
3939
{
40-
const TESTED_TYPE = 'Symfony\Bridge\Doctrine\Form\Type\EntityType';
40+
public const TESTED_TYPE = 'Symfony\Bridge\Doctrine\Form\Type\EntityType';
4141

4242
private const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\GroupableEntity';
4343
private const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
2525
class UniqueEntity extends Constraint
2626
{
27-
const NOT_UNIQUE_ERROR = '23bd9dbf-6b9b-41cd-a99e-4844bcf3077f';
27+
public const NOT_UNIQUE_ERROR = '23bd9dbf-6b9b-41cd-a99e-4844bcf3077f';
2828

2929
public $message = 'This value is already used.';
3030
public $service = 'doctrine.orm.validator.unique';

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
*/
2828
class ConsoleFormatter implements FormatterInterface
2929
{
30-
const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag% <comment>[%channel%]</> %message%%context%%extra%\n";
31-
const SIMPLE_DATE = 'H:i:s';
30+
public const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag% <comment>[%channel%]</> %message%%context%%extra%\n";
31+
public const SIMPLE_DATE = 'H:i:s';
3232

3333
private static $levelColorMap = [
3434
Logger::DEBUG => 'fg=white',

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
*/
2626
class DeprecationErrorHandler
2727
{
28-
const MODE_DISABLED = 'disabled';
29-
const MODE_WEAK = 'max[total]=999999&verbose=0';
30-
const MODE_STRICT = 'max[total]=0';
28+
public const MODE_DISABLED = 'disabled';
29+
public const MODE_WEAK = 'max[total]=999999&verbose=0';
30+
public const MODE_STRICT = 'max[total]=0';
3131

3232
private $mode;
3333
private $configuration;

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
*/
2222
class Deprecation
2323
{
24-
const PATH_TYPE_VENDOR = 'path_type_vendor';
25-
const PATH_TYPE_SELF = 'path_type_internal';
26-
const PATH_TYPE_UNDETERMINED = 'path_type_undetermined';
27-
28-
const TYPE_SELF = 'type_self';
29-
const TYPE_DIRECT = 'type_direct';
30-
const TYPE_INDIRECT = 'type_indirect';
31-
const TYPE_UNDETERMINED = 'type_undetermined';
24+
public const PATH_TYPE_VENDOR = 'path_type_vendor';
25+
public const PATH_TYPE_SELF = 'path_type_internal';
26+
public const PATH_TYPE_UNDETERMINED = 'path_type_undetermined';
27+
28+
public const TYPE_SELF = 'type_self';
29+
public const TYPE_DIRECT = 'type_direct';
30+
public const TYPE_INDIRECT = 'type_indirect';
31+
public const TYPE_UNDETERMINED = 'type_undetermined';
3232

3333
private $trace = [];
3434
private $message;

src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
final class TranslationNodeVisitor extends AbstractNodeVisitor
2828
{
29-
const UNDEFINED_DOMAIN = '_undefined';
29+
public const UNDEFINED_DOMAIN = '_undefined';
3030

3131
private $enabled = false;
3232
private $messages = [];

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
*/
3636
class AssetsInstallCommand extends Command
3737
{
38-
const METHOD_COPY = 'copy';
39-
const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
40-
const METHOD_RELATIVE_SYMLINK = 'relative symlink';
38+
public const METHOD_COPY = 'copy';
39+
public const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
40+
public const METHOD_RELATIVE_SYMLINK = 'relative symlink';
4141

4242
protected static $defaultName = 'assets:install';
4343

src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
*/
3939
class TranslationDebugCommand extends Command
4040
{
41-
const EXIT_CODE_GENERAL_ERROR = 64;
42-
const EXIT_CODE_MISSING = 65;
43-
const EXIT_CODE_UNUSED = 66;
44-
const EXIT_CODE_FALLBACK = 68;
45-
const MESSAGE_MISSING = 0;
46-
const MESSAGE_UNUSED = 1;
47-
const MESSAGE_EQUALS_FALLBACK = 2;
41+
public const EXIT_CODE_GENERAL_ERROR = 64;
42+
public const EXIT_CODE_MISSING = 65;
43+
public const EXIT_CODE_UNUSED = 66;
44+
public const EXIT_CODE_FALLBACK = 68;
45+
public const MESSAGE_MISSING = 0;
46+
public const MESSAGE_UNUSED = 1;
47+
public const MESSAGE_EQUALS_FALLBACK = 2;
4848

4949
protected static $defaultName = 'debug:translation';
5050

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FirewallEntryPointBundle/Security/EntryPointStub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class EntryPointStub implements AuthenticationEntryPointInterface
2020
{
21-
const RESPONSE_TEXT = '2be8e651259189d841a19eecdf37e771e2431741';
21+
public const RESPONSE_TEXT = '2be8e651259189d841a19eecdf37e771e2431741';
2222

2323
public function start(Request $request, AuthenticationException $authException = null): Response
2424
{

src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
*/
3636
class WebDebugToolbarListener implements EventSubscriberInterface
3737
{
38-
const DISABLED = 1;
39-
const ENABLED = 2;
38+
public const DISABLED = 1;
39+
public const ENABLED = 2;
4040

4141
protected $twig;
4242
protected $urlGenerator;

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterface, PruneableInterface, ResettableInterface
2727
{
28-
const TAGS_PREFIX = "\0tags\0";
28+
public const TAGS_PREFIX = "\0tags\0";
2929

3030
use ContractsTrait;
3131
use ProxyTrait;

src/Symfony/Component/Config/Definition/BaseNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
abstract class BaseNode implements NodeInterface
2626
{
27-
const DEFAULT_PATH_SEPARATOR = '.';
27+
public const DEFAULT_PATH_SEPARATOR = '.';
2828

2929
private static $placeholderUniquePrefixes = [];
3030
private static $placeholders = [];

src/Symfony/Component/Console/ConsoleEvents.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ final class ConsoleEvents
3030
*
3131
* @Event("Symfony\Component\Console\Event\ConsoleCommandEvent")
3232
*/
33-
const COMMAND = 'console.command';
33+
public const COMMAND = 'console.command';
3434

3535
/**
3636
* The SIGNAL event allows you to perform some actions
3737
* after the command execution was interrupted.
3838
*
3939
* @Event("Symfony\Component\Console\Event\ConsoleSignalEvent")
4040
*/
41-
const SIGNAL = 'console.signal';
41+
public const SIGNAL = 'console.signal';
4242

4343
/**
4444
* The TERMINATE event allows you to attach listeners after a command is
4545
* executed by the console.
4646
*
4747
* @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent")
4848
*/
49-
const TERMINATE = 'console.terminate';
49+
public const TERMINATE = 'console.terminate';
5050

5151
/**
5252
* The ERROR event occurs when an uncaught exception or error appears.
@@ -56,14 +56,14 @@ final class ConsoleEvents
5656
*
5757
* @Event("Symfony\Component\Console\Event\ConsoleErrorEvent")
5858
*/
59-
const ERROR = 'console.error';
59+
public const ERROR = 'console.error';
6060

6161
/**
6262
* Event aliases.
6363
*
6464
* These aliases can be consumed by RegisterListenersPass.
6565
*/
66-
const ALIASES = [
66+
public const ALIASES = [
6767
ConsoleCommandEvent::class => self::COMMAND,
6868
ConsoleErrorEvent::class => self::ERROR,
6969
ConsoleSignalEvent::class => self::SIGNAL,

src/Symfony/Component/Console/Descriptor/ApplicationDescription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class ApplicationDescription
2424
{
25-
const GLOBAL_NAMESPACE = '_global';
25+
public const GLOBAL_NAMESPACE = '_global';
2626

2727
private $application;
2828
private $namespace;

src/Symfony/Component/Console/Event/ConsoleCommandEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ConsoleCommandEvent extends ConsoleEvent
2121
/**
2222
* The return code for skipped commands, this will also be passed into the terminate event.
2323
*/
24-
const RETURN_CODE_DISABLED = 113;
24+
public const RETURN_CODE_DISABLED = 113;
2525

2626
/**
2727
* Indicates if the command should be run or skipped.

src/Symfony/Component/Console/Helper/TableCellStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class TableCellStyle
2020
{
21-
const DEFAULT_ALIGN = 'left';
21+
public const DEFAULT_ALIGN = 'left';
2222

2323
private $options = [
2424
'fg' => 'default',

src/Symfony/Component/Console/Input/InputArgument.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
*/
2222
class InputArgument
2323
{
24-
const REQUIRED = 1;
25-
const OPTIONAL = 2;
26-
const IS_ARRAY = 4;
24+
public const REQUIRED = 1;
25+
public const OPTIONAL = 2;
26+
public const IS_ARRAY = 4;
2727

2828
private $name;
2929
private $mode;

src/Symfony/Component/Console/Input/InputOption.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
*/
2222
class InputOption
2323
{
24-
const VALUE_NONE = 1;
25-
const VALUE_REQUIRED = 2;
26-
const VALUE_OPTIONAL = 4;
27-
const VALUE_IS_ARRAY = 8;
24+
public const VALUE_NONE = 1;
25+
public const VALUE_REQUIRED = 2;
26+
public const VALUE_OPTIONAL = 4;
27+
public const VALUE_IS_ARRAY = 8;
2828

2929
private $name;
3030
private $shortcut;

src/Symfony/Component/Console/Input/StringInput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
class StringInput extends ArgvInput
2626
{
27-
const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
28-
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
27+
public const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
28+
public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
2929

3030
/**
3131
* @param string $input A string representing the parameters from the CLI

src/Symfony/Component/Console/Logger/ConsoleLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
*/
2727
class ConsoleLogger extends AbstractLogger
2828
{
29-
const INFO = 'info';
30-
const ERROR = 'error';
29+
public const INFO = 'info';
30+
public const ERROR = 'error';
3131

3232
private $output;
3333
private $verbosityLevelMap = [

src/Symfony/Component/Console/Output/OutputInterface.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
*/
2121
interface OutputInterface
2222
{
23-
const VERBOSITY_QUIET = 16;
24-
const VERBOSITY_NORMAL = 32;
25-
const VERBOSITY_VERBOSE = 64;
26-
const VERBOSITY_VERY_VERBOSE = 128;
27-
const VERBOSITY_DEBUG = 256;
28-
29-
const OUTPUT_NORMAL = 1;
30-
const OUTPUT_RAW = 2;
31-
const OUTPUT_PLAIN = 4;
23+
public const VERBOSITY_QUIET = 16;
24+
public const VERBOSITY_NORMAL = 32;
25+
public const VERBOSITY_VERBOSE = 64;
26+
public const VERBOSITY_VERY_VERBOSE = 128;
27+
public const VERBOSITY_DEBUG = 256;
28+
29+
public const OUTPUT_NORMAL = 1;
30+
public const OUTPUT_RAW = 2;
31+
public const OUTPUT_PLAIN = 4;
3232

3333
/**
3434
* Writes a message to the output.

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
class SymfonyStyle extends OutputStyle
3737
{
38-
const MAX_LINE_LENGTH = 120;
38+
public const MAX_LINE_LENGTH = 120;
3939

4040
private $input;
4141
private $questionHelper;

src/Symfony/Component/CssSelector/Node/Specificity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
*/
2626
class Specificity
2727
{
28-
const A_FACTOR = 100;
29-
const B_FACTOR = 10;
30-
const C_FACTOR = 1;
28+
public const A_FACTOR = 100;
29+
public const B_FACTOR = 10;
30+
public const C_FACTOR = 1;
3131

3232
private $a;
3333
private $b;

src/Symfony/Component/CssSelector/Parser/Token.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
*/
2424
class Token
2525
{
26-
const TYPE_FILE_END = 'eof';
27-
const TYPE_DELIMITER = 'delimiter';
28-
const TYPE_WHITESPACE = 'whitespace';
29-
const TYPE_IDENTIFIER = 'identifier';
30-
const TYPE_HASH = 'hash';
31-
const TYPE_NUMBER = 'number';
32-
const TYPE_STRING = 'string';
26+
public const TYPE_FILE_END = 'eof';
27+
public const TYPE_DELIMITER = 'delimiter';
28+
public const TYPE_WHITESPACE = 'whitespace';
29+
public const TYPE_IDENTIFIER = 'identifier';
30+
public const TYPE_HASH = 'hash';
31+
public const TYPE_NUMBER = 'number';
32+
public const TYPE_STRING = 'string';
3333

3434
private $type;
3535
private $value;

src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
*/
2828
class NodeExtension extends AbstractExtension
2929
{
30-
const ELEMENT_NAME_IN_LOWER_CASE = 1;
31-
const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
32-
const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
30+
public const ELEMENT_NAME_IN_LOWER_CASE = 1;
31+
public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
32+
public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
3333

3434
private $flags;
3535

src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
final class BoundArgument implements ArgumentInterface
1818
{
19-
const SERVICE_BINDING = 0;
20-
const DEFAULTS_BINDING = 1;
21-
const INSTANCEOF_BINDING = 2;
19+
public const SERVICE_BINDING = 0;
20+
public const DEFAULTS_BINDING = 1;
21+
public const INSTANCEOF_BINDING = 2;
2222

2323
private static $sequence = 0;
2424

src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
*/
2323
class PassConfig
2424
{
25-
const TYPE_AFTER_REMOVING = 'afterRemoving';
26-
const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization';
27-
const TYPE_BEFORE_REMOVING = 'beforeRemoving';
28-
const TYPE_OPTIMIZE = 'optimization';
29-
const TYPE_REMOVE = 'removing';
25+
public const TYPE_AFTER_REMOVING = 'afterRemoving';
26+
public const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization';
27+
public const TYPE_BEFORE_REMOVING = 'beforeRemoving';
28+
public const TYPE_OPTIMIZE = 'optimization';
29+
public const TYPE_REMOVE = 'removing';
3030

3131
private $mergePass;
3232
private $afterRemovingPasses = [];

0 commit comments

Comments
 (0)
0