Skip to content

Commit bbce94f

Browse files
Apply "visibility_required" CS rule to constants
php-cs-fixer fix --rules='{"visibility_required": ["property", "method", "const"]}'
1 parent 8fe9e4e commit bbce94f

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

Escaper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class Escaper
2323
{
2424
// Characters that would cause a dumped string to require double quoting.
25-
const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9";
25+
public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9";
2626

2727
// Mapping arrays for escaping a double quoted string. The backslash is
2828
// first to ensure proper escaping because str_replace operates iteratively

Inline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class Inline
2626
{
27-
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')';
27+
public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')';
2828

2929
public static $parsedLineNumber = -1;
3030
public static $parsedFilename;

Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*/
2424
class Parser
2525
{
26-
const TAG_PATTERN = '(?P<tag>![\w!.\/:-]+)';
27-
const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?';
26+
public const TAG_PATTERN = '(?P<tag>![\w!.\/:-]+)';
27+
public const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?';
2828

2929
private $filename;
3030
private $offset = 0;

Tests/Command/LintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,5 @@ protected function tearDown(): void
139139

140140
class Foo
141141
{
142-
const TEST = 'foo';
142+
public const TEST = 'foo';
143143
}

Tests/ParserTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,7 @@ class B
27392739
{
27402740
public $b = 'foo';
27412741

2742-
const FOO = 'foo';
2743-
const BAR = 'bar';
2744-
const BAZ = 'baz';
2742+
public const FOO = 'foo';
2743+
public const BAR = 'bar';
2744+
public const BAZ = 'baz';
27452745
}

Unescaper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Unescaper
2626
/**
2727
* Regex fragment that matches an escaped character in a double quoted string.
2828
*/
29-
const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)';
29+
public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)';
3030

3131
/**
3232
* Unescapes a single quoted string.

Yaml.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
*/
2323
class Yaml
2424
{
25-
const DUMP_OBJECT = 1;
26-
const PARSE_EXCEPTION_ON_INVALID_TYPE = 2;
27-
const PARSE_OBJECT = 4;
28-
const PARSE_OBJECT_FOR_MAP = 8;
29-
const DUMP_EXCEPTION_ON_INVALID_TYPE = 16;
30-
const PARSE_DATETIME = 32;
31-
const DUMP_OBJECT_AS_MAP = 64;
32-
const DUMP_MULTI_LINE_LITERAL_BLOCK = 128;
33-
const PARSE_CONSTANT = 256;
34-
const PARSE_CUSTOM_TAGS = 512;
35-
const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
36-
const DUMP_NULL_AS_TILDE = 2048;
25+
public const DUMP_OBJECT = 1;
26+
public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2;
27+
public const PARSE_OBJECT = 4;
28+
public const PARSE_OBJECT_FOR_MAP = 8;
29+
public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16;
30+
public const PARSE_DATETIME = 32;
31+
public const DUMP_OBJECT_AS_MAP = 64;
32+
public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128;
33+
public const PARSE_CONSTANT = 256;
34+
public const PARSE_CUSTOM_TAGS = 512;
35+
public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
36+
public const DUMP_NULL_AS_TILDE = 2048;
3737

3838
/**
3939
* Parses a YAML file into a PHP value.

0 commit comments

Comments
 (0)