Skip to content

Commit

Permalink
Apply "visibility_required" CS rule to constants
Browse files Browse the repository at this point in the history
php-cs-fixer fix --rules='{"visibility_required": ["property", "method", "const"]}'
  • Loading branch information
nicolas-grekas committed Dec 8, 2020
1 parent a7fcb0b commit ff22d30
Show file tree
Hide file tree
Showing 227 changed files with 840 additions and 840 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
Expand Up @@ -20,8 +20,8 @@
*/
class DbalLogger implements SQLLogger
{
const MAX_STRING_LENGTH = 32;
const BINARY_DATA_VALUE = '(binary value)';
public const MAX_STRING_LENGTH = 32;
public const BINARY_DATA_VALUE = '(binary value)';

protected $logger;
protected $stopwatch;
Expand Down
Expand Up @@ -37,7 +37,7 @@

class EntityTypeTest extends BaseTypeTest
{
const TESTED_TYPE = 'Symfony\Bridge\Doctrine\Form\Type\EntityType';
public const TESTED_TYPE = 'Symfony\Bridge\Doctrine\Form\Type\EntityType';

private const ITEM_GROUP_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\GroupableEntity';
private const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';
Expand Down
Expand Up @@ -23,7 +23,7 @@
*/
class UniqueEntity extends Constraint
{
const NOT_UNIQUE_ERROR = '23bd9dbf-6b9b-41cd-a99e-4844bcf3077f';
public const NOT_UNIQUE_ERROR = '23bd9dbf-6b9b-41cd-a99e-4844bcf3077f';

public $message = 'This value is already used.';
public $service = 'doctrine.orm.validator.unique';
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php
Expand Up @@ -27,8 +27,8 @@
*/
class ConsoleFormatter implements FormatterInterface
{
const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag% <comment>[%channel%]</> %message%%context%%extra%\n";
const SIMPLE_DATE = 'H:i:s';
public const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag% <comment>[%channel%]</> %message%%context%%extra%\n";
public const SIMPLE_DATE = 'H:i:s';

private static $levelColorMap = [
Logger::DEBUG => 'fg=white',
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
Expand Up @@ -27,11 +27,11 @@ class DeprecationErrorHandler
/**
* @deprecated since Symfony 4.3, use max[self]=0 instead
*/
const MODE_WEAK_VENDORS = 'weak_vendors';
public const MODE_WEAK_VENDORS = 'weak_vendors';

const MODE_DISABLED = 'disabled';
const MODE_WEAK = 'max[total]=999999&verbose=0';
const MODE_STRICT = 'max[total]=0';
public const MODE_DISABLED = 'disabled';
public const MODE_WEAK = 'max[total]=999999&verbose=0';
public const MODE_STRICT = 'max[total]=0';

private $mode;
private $configuration;
Expand Down
Expand Up @@ -21,14 +21,14 @@
*/
class Deprecation
{
const PATH_TYPE_VENDOR = 'path_type_vendor';
const PATH_TYPE_SELF = 'path_type_internal';
const PATH_TYPE_UNDETERMINED = 'path_type_undetermined';

const TYPE_SELF = 'type_self';
const TYPE_DIRECT = 'type_direct';
const TYPE_INDIRECT = 'type_indirect';
const TYPE_UNDETERMINED = 'type_undetermined';
public const PATH_TYPE_VENDOR = 'path_type_vendor';
public const PATH_TYPE_SELF = 'path_type_internal';
public const PATH_TYPE_UNDETERMINED = 'path_type_undetermined';

public const TYPE_SELF = 'type_self';
public const TYPE_DIRECT = 'type_direct';
public const TYPE_INDIRECT = 'type_indirect';
public const TYPE_UNDETERMINED = 'type_undetermined';

private $trace = [];
private $message;
Expand Down
Expand Up @@ -27,7 +27,7 @@
*/
class TranslationNodeVisitor extends AbstractNodeVisitor
{
const UNDEFINED_DOMAIN = '_undefined';
public const UNDEFINED_DOMAIN = '_undefined';

private $enabled = false;
private $messages = [];
Expand Down
Expand Up @@ -35,9 +35,9 @@
*/
class AssetsInstallCommand extends Command
{
const METHOD_COPY = 'copy';
const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
const METHOD_RELATIVE_SYMLINK = 'relative symlink';
public const METHOD_COPY = 'copy';
public const METHOD_ABSOLUTE_SYMLINK = 'absolute symlink';
public const METHOD_RELATIVE_SYMLINK = 'relative symlink';

protected static $defaultName = 'assets:install';

Expand Down
Expand Up @@ -39,9 +39,9 @@
*/
class TranslationDebugCommand extends Command
{
const MESSAGE_MISSING = 0;
const MESSAGE_UNUSED = 1;
const MESSAGE_EQUALS_FALLBACK = 2;
public const MESSAGE_MISSING = 0;
public const MESSAGE_UNUSED = 1;
public const MESSAGE_EQUALS_FALLBACK = 2;

protected static $defaultName = 'debug:translation';

Expand Down
Expand Up @@ -18,7 +18,7 @@

class EntryPointStub implements AuthenticationEntryPointInterface
{
const RESPONSE_TEXT = '2be8e651259189d841a19eecdf37e771e2431741';
public const RESPONSE_TEXT = '2be8e651259189d841a19eecdf37e771e2431741';

public function start(Request $request, AuthenticationException $authException = null): Response
{
Expand Down
Expand Up @@ -35,8 +35,8 @@
*/
class WebDebugToolbarListener implements EventSubscriberInterface
{
const DISABLED = 1;
const ENABLED = 2;
public const DISABLED = 1;
public const ENABLED = 2;

protected $twig;
protected $urlGenerator;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/WebServerBundle/WebServer.php
Expand Up @@ -24,8 +24,8 @@
*/
class WebServer
{
const STARTED = 0;
const STOPPED = 1;
public const STARTED = 0;
public const STOPPED = 1;

private $pidFileDirectory;

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php
Expand Up @@ -25,7 +25,7 @@
*/
class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterface, PruneableInterface, ResettableInterface
{
const TAGS_PREFIX = "\0tags\0";
public const TAGS_PREFIX = "\0tags\0";

use ContractsTrait;
use ProxyTrait;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Definition/BaseNode.php
Expand Up @@ -24,7 +24,7 @@
*/
abstract class BaseNode implements NodeInterface
{
const DEFAULT_PATH_SEPARATOR = '.';
public const DEFAULT_PATH_SEPARATOR = '.';

private static $placeholderUniquePrefixes = [];
private static $placeholders = [];
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/ConsoleEvents.php
Expand Up @@ -25,15 +25,15 @@ final class ConsoleEvents
*
* @Event("Symfony\Component\Console\Event\ConsoleCommandEvent")
*/
const COMMAND = 'console.command';
public const COMMAND = 'console.command';

/**
* The TERMINATE event allows you to attach listeners after a command is
* executed by the console.
*
* @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent")
*/
const TERMINATE = 'console.terminate';
public const TERMINATE = 'console.terminate';

/**
* The ERROR event occurs when an uncaught exception or error appears.
Expand All @@ -43,5 +43,5 @@ final class ConsoleEvents
*
* @Event("Symfony\Component\Console\Event\ConsoleErrorEvent")
*/
const ERROR = 'console.error';
public const ERROR = 'console.error';
}
Expand Up @@ -22,7 +22,7 @@
*/
class ApplicationDescription
{
const GLOBAL_NAMESPACE = '_global';
public const GLOBAL_NAMESPACE = '_global';

private $application;
private $namespace;
Expand Down
Expand Up @@ -23,7 +23,7 @@ class ConsoleCommandEvent extends ConsoleEvent
/**
* The return code for skipped commands, this will also be passed into the terminate event.
*/
const RETURN_CODE_DISABLED = 113;
public const RETURN_CODE_DISABLED = 113;

/**
* Indicates if the command should be run or skipped.
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Input/InputArgument.php
Expand Up @@ -21,9 +21,9 @@
*/
class InputArgument
{
const REQUIRED = 1;
const OPTIONAL = 2;
const IS_ARRAY = 4;
public const REQUIRED = 1;
public const OPTIONAL = 2;
public const IS_ARRAY = 4;

private $name;
private $mode;
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/Console/Input/InputOption.php
Expand Up @@ -21,10 +21,10 @@
*/
class InputOption
{
const VALUE_NONE = 1;
const VALUE_REQUIRED = 2;
const VALUE_OPTIONAL = 4;
const VALUE_IS_ARRAY = 8;
public const VALUE_NONE = 1;
public const VALUE_REQUIRED = 2;
public const VALUE_OPTIONAL = 4;
public const VALUE_IS_ARRAY = 8;

private $name;
private $shortcut;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Input/StringInput.php
Expand Up @@ -24,8 +24,8 @@
*/
class StringInput extends ArgvInput
{
const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
public const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';

/**
* @param string $input A string representing the parameters from the CLI
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Logger/ConsoleLogger.php
Expand Up @@ -26,8 +26,8 @@
*/
class ConsoleLogger extends AbstractLogger
{
const INFO = 'info';
const ERROR = 'error';
public const INFO = 'info';
public const ERROR = 'error';

private $output;
private $verbosityLevelMap = [
Expand Down
18 changes: 9 additions & 9 deletions src/Symfony/Component/Console/Output/OutputInterface.php
Expand Up @@ -20,15 +20,15 @@
*/
interface OutputInterface
{
const VERBOSITY_QUIET = 16;
const VERBOSITY_NORMAL = 32;
const VERBOSITY_VERBOSE = 64;
const VERBOSITY_VERY_VERBOSE = 128;
const VERBOSITY_DEBUG = 256;

const OUTPUT_NORMAL = 1;
const OUTPUT_RAW = 2;
const OUTPUT_PLAIN = 4;
public const VERBOSITY_QUIET = 16;
public const VERBOSITY_NORMAL = 32;
public const VERBOSITY_VERBOSE = 64;
public const VERBOSITY_VERY_VERBOSE = 128;
public const VERBOSITY_DEBUG = 256;

public const OUTPUT_NORMAL = 1;
public const OUTPUT_RAW = 2;
public const OUTPUT_PLAIN = 4;

/**
* Writes a message to the output.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Style/SymfonyStyle.php
Expand Up @@ -35,7 +35,7 @@
*/
class SymfonyStyle extends OutputStyle
{
const MAX_LINE_LENGTH = 120;
public const MAX_LINE_LENGTH = 120;

private $input;
private $questionHelper;
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/CssSelector/Node/Specificity.php
Expand Up @@ -25,9 +25,9 @@
*/
class Specificity
{
const A_FACTOR = 100;
const B_FACTOR = 10;
const C_FACTOR = 1;
public const A_FACTOR = 100;
public const B_FACTOR = 10;
public const C_FACTOR = 1;

private $a;
private $b;
Expand Down
14 changes: 7 additions & 7 deletions src/Symfony/Component/CssSelector/Parser/Token.php
Expand Up @@ -23,13 +23,13 @@
*/
class Token
{
const TYPE_FILE_END = 'eof';
const TYPE_DELIMITER = 'delimiter';
const TYPE_WHITESPACE = 'whitespace';
const TYPE_IDENTIFIER = 'identifier';
const TYPE_HASH = 'hash';
const TYPE_NUMBER = 'number';
const TYPE_STRING = 'string';
public const TYPE_FILE_END = 'eof';
public const TYPE_DELIMITER = 'delimiter';
public const TYPE_WHITESPACE = 'whitespace';
public const TYPE_IDENTIFIER = 'identifier';
public const TYPE_HASH = 'hash';
public const TYPE_NUMBER = 'number';
public const TYPE_STRING = 'string';

private $type;
private $value;
Expand Down
Expand Up @@ -27,9 +27,9 @@
*/
class NodeExtension extends AbstractExtension
{
const ELEMENT_NAME_IN_LOWER_CASE = 1;
const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
public const ELEMENT_NAME_IN_LOWER_CASE = 1;
public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;

private $flags;

Expand Down
Expand Up @@ -16,9 +16,9 @@
*/
final class BoundArgument implements ArgumentInterface
{
const SERVICE_BINDING = 0;
const DEFAULTS_BINDING = 1;
const INSTANCEOF_BINDING = 2;
public const SERVICE_BINDING = 0;
public const DEFAULTS_BINDING = 1;
public const INSTANCEOF_BINDING = 2;

private static $sequence = 0;

Expand Down
Expand Up @@ -22,11 +22,11 @@
*/
class PassConfig
{
const TYPE_AFTER_REMOVING = 'afterRemoving';
const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization';
const TYPE_BEFORE_REMOVING = 'beforeRemoving';
const TYPE_OPTIMIZE = 'optimization';
const TYPE_REMOVE = 'removing';
public const TYPE_AFTER_REMOVING = 'afterRemoving';
public const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization';
public const TYPE_BEFORE_REMOVING = 'beforeRemoving';
public const TYPE_OPTIMIZE = 'optimization';
public const TYPE_REMOVE = 'removing';

private $mergePass;
private $afterRemovingPasses = [];
Expand Down
10 changes: 5 additions & 5 deletions src/Symfony/Component/DependencyInjection/ContainerInterface.php
Expand Up @@ -24,11 +24,11 @@
*/
interface ContainerInterface extends PsrContainerInterface
{
const RUNTIME_EXCEPTION_ON_INVALID_REFERENCE = 0;
const EXCEPTION_ON_INVALID_REFERENCE = 1;
const NULL_ON_INVALID_REFERENCE = 2;
const IGNORE_ON_INVALID_REFERENCE = 3;
const IGNORE_ON_UNINITIALIZED_REFERENCE = 4;
public const RUNTIME_EXCEPTION_ON_INVALID_REFERENCE = 0;
public const EXCEPTION_ON_INVALID_REFERENCE = 1;
public const NULL_ON_INVALID_REFERENCE = 2;
public const IGNORE_ON_INVALID_REFERENCE = 3;
public const IGNORE_ON_UNINITIALIZED_REFERENCE = 4;

/**
* Sets a service.
Expand Down
Expand Up @@ -54,12 +54,12 @@ class PhpDumper extends Dumper
/**
* Characters that might appear in the generated variable name as first character.
*/
const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz';
public const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz';

/**
* Characters that might appear in the generated variable name as any but the first character.
*/
const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_';
public const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_';

private $definitionVariables;
private $referenceVariables;
Expand Down

0 comments on commit ff22d30

Please sign in to comment.