File tree Expand file tree Collapse file tree 7 files changed +21
-21
lines changed Expand file tree Collapse file tree 7 files changed +21
-21
lines changed Original file line number Diff line number Diff line change 22
22
class Escaper
23
23
{
24
24
// 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" ;
26
26
27
27
// Mapping arrays for escaping a double quoted string. The backslash is
28
28
// first to ensure proper escaping because str_replace operates iteratively
Original file line number Diff line number Diff line change 24
24
*/
25
25
class Inline
26
26
{
27
- const REGEX_QUOTED_STRING = '(?:"([^" \\\\]*+(?: \\\\.[^" \\\\]*+)*+)"| \'([^ \']*+(?: \'\'[^ \']*+)*+) \') ' ;
27
+ public const REGEX_QUOTED_STRING = '(?:"([^" \\\\]*+(?: \\\\.[^" \\\\]*+)*+)"| \'([^ \']*+(?: \'\'[^ \']*+)*+) \') ' ;
28
28
29
29
public static $ parsedLineNumber = -1 ;
30
30
public static $ parsedFilename ;
Original file line number Diff line number Diff line change 23
23
*/
24
24
class Parser
25
25
{
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> +#.*)? ' ;
28
28
29
29
private $ filename ;
30
30
private $ offset = 0 ;
Original file line number Diff line number Diff line change @@ -139,5 +139,5 @@ protected function tearDown(): void
139
139
140
140
class Foo
141
141
{
142
- const TEST = 'foo ' ;
142
+ public const TEST = 'foo ' ;
143
143
}
Original file line number Diff line number Diff line change @@ -2739,7 +2739,7 @@ class B
2739
2739
{
2740
2740
public $ b = 'foo ' ;
2741
2741
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 ' ;
2745
2745
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class Unescaper
26
26
/**
27
27
* Regex fragment that matches an escaped character in a double quoted string.
28
28
*/
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}|.) ' ;
30
30
31
31
/**
32
32
* Unescapes a single quoted string.
Original file line number Diff line number Diff line change 22
22
*/
23
23
class Yaml
24
24
{
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 ;
37
37
38
38
/**
39
39
* Parses a YAML file into a PHP value.
You can’t perform that action at this time.
0 commit comments