Skip to content

Commit 679fae6

Browse files
Merge branch '5.2' into 5.x
* 5.2: Update .php_cs.dist Apply "visibility_required" CS rule to constants
2 parents cc58889 + 7f17092 commit 679fae6

File tree

7 files changed

+124
-124
lines changed

7 files changed

+124
-124
lines changed

Collator/Collator.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,38 @@
3838
abstract class Collator
3939
{
4040
/* Attribute constants */
41-
const FRENCH_COLLATION = 0;
42-
const ALTERNATE_HANDLING = 1;
43-
const CASE_FIRST = 2;
44-
const CASE_LEVEL = 3;
45-
const NORMALIZATION_MODE = 4;
46-
const STRENGTH = 5;
47-
const HIRAGANA_QUATERNARY_MODE = 6;
48-
const NUMERIC_COLLATION = 7;
41+
public const FRENCH_COLLATION = 0;
42+
public const ALTERNATE_HANDLING = 1;
43+
public const CASE_FIRST = 2;
44+
public const CASE_LEVEL = 3;
45+
public const NORMALIZATION_MODE = 4;
46+
public const STRENGTH = 5;
47+
public const HIRAGANA_QUATERNARY_MODE = 6;
48+
public const NUMERIC_COLLATION = 7;
4949

5050
/* Attribute constants values */
51-
const DEFAULT_VALUE = -1;
51+
public const DEFAULT_VALUE = -1;
5252

53-
const PRIMARY = 0;
54-
const SECONDARY = 1;
55-
const TERTIARY = 2;
56-
const DEFAULT_STRENGTH = 2;
57-
const QUATERNARY = 3;
58-
const IDENTICAL = 15;
53+
public const PRIMARY = 0;
54+
public const SECONDARY = 1;
55+
public const TERTIARY = 2;
56+
public const DEFAULT_STRENGTH = 2;
57+
public const QUATERNARY = 3;
58+
public const IDENTICAL = 15;
5959

60-
const OFF = 16;
61-
const ON = 17;
60+
public const OFF = 16;
61+
public const ON = 17;
6262

63-
const SHIFTED = 20;
64-
const NON_IGNORABLE = 21;
63+
public const SHIFTED = 20;
64+
public const NON_IGNORABLE = 21;
6565

66-
const LOWER_FIRST = 24;
67-
const UPPER_FIRST = 25;
66+
public const LOWER_FIRST = 24;
67+
public const UPPER_FIRST = 25;
6868

6969
/* Sorting options */
70-
const SORT_REGULAR = 0;
71-
const SORT_NUMERIC = 2;
72-
const SORT_STRING = 1;
70+
public const SORT_REGULAR = 0;
71+
public const SORT_NUMERIC = 2;
72+
public const SORT_STRING = 1;
7373

7474
/**
7575
* @param string|null $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")

DateFormatter/IntlDateFormatter.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ abstract class IntlDateFormatter
6565
protected $errorMessage = 'U_ZERO_ERROR';
6666

6767
/* date/time format types */
68-
const NONE = -1;
69-
const FULL = 0;
70-
const LONG = 1;
71-
const MEDIUM = 2;
72-
const SHORT = 3;
68+
public const NONE = -1;
69+
public const FULL = 0;
70+
public const LONG = 1;
71+
public const MEDIUM = 2;
72+
public const SHORT = 3;
7373

7474
/* calendar formats */
75-
const TRADITIONAL = 0;
76-
const GREGORIAN = 1;
75+
public const TRADITIONAL = 0;
76+
public const GREGORIAN = 1;
7777

7878
/**
7979
* Patterns used to format the date when no pattern is provided.

Exception/NotImplementedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class NotImplementedException extends RuntimeException
2222
{
23-
const INTL_INSTALL_MESSAGE = 'Please install the "intl" extension for full localization capabilities.';
23+
public const INTL_INSTALL_MESSAGE = 'Please install the "intl" extension for full localization capabilities.';
2424

2525
/**
2626
* @param string $message The exception message. A note to install the intl extension is appended to this string

Globals/IntlGlobals.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ abstract class IntlGlobals
2727
/**
2828
* Indicates that no error occurred.
2929
*/
30-
const U_ZERO_ERROR = 0;
30+
public const U_ZERO_ERROR = 0;
3131

3232
/**
3333
* Indicates that an invalid argument was passed.
3434
*/
35-
const U_ILLEGAL_ARGUMENT_ERROR = 1;
35+
public const U_ILLEGAL_ARGUMENT_ERROR = 1;
3636

3737
/**
3838
* Indicates that the parse() operation failed.
3939
*/
40-
const U_PARSE_ERROR = 9;
40+
public const U_PARSE_ERROR = 9;
4141

4242
/**
4343
* All known error codes.

Intl.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ final class Intl
2222
* The number of resource bundles to buffer. Loading the same resource
2323
* bundle for n locales takes up n spots in the buffer.
2424
*/
25-
const BUFFER_SIZE = 10;
25+
public const BUFFER_SIZE = 10;
2626

2727
/**
2828
* The directory name of the currency data.
2929
*/
30-
const CURRENCY_DIR = 'currencies';
30+
public const CURRENCY_DIR = 'currencies';
3131

3232
/**
3333
* The directory name of the language data.
3434
*/
35-
const LANGUAGE_DIR = 'languages';
35+
public const LANGUAGE_DIR = 'languages';
3636

3737
/**
3838
* The directory name of the script data.
3939
*/
40-
const SCRIPT_DIR = 'scripts';
40+
public const SCRIPT_DIR = 'scripts';
4141

4242
/**
4343
* The directory name of the locale data.
4444
*/
45-
const LOCALE_DIR = 'locales';
45+
public const LOCALE_DIR = 'locales';
4646

4747
/**
4848
* The directory name of the region data.
4949
*/
50-
const REGION_DIR = 'regions';
50+
public const REGION_DIR = 'regions';
5151

5252
/**
5353
* The directory name of the zone data.

Locale/Locale.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@
2828
*/
2929
abstract class Locale
3030
{
31-
const DEFAULT_LOCALE = null;
31+
public const DEFAULT_LOCALE = null;
3232

3333
/* Locale method constants */
34-
const ACTUAL_LOCALE = 0;
35-
const VALID_LOCALE = 1;
34+
public const ACTUAL_LOCALE = 0;
35+
public const VALID_LOCALE = 1;
3636

3737
/* Language tags constants */
38-
const LANG_TAG = 'language';
39-
const EXTLANG_TAG = 'extlang';
40-
const SCRIPT_TAG = 'script';
41-
const REGION_TAG = 'region';
42-
const VARIANT_TAG = 'variant';
43-
const GRANDFATHERED_LANG_TAG = 'grandfathered';
44-
const PRIVATE_TAG = 'private';
38+
public const LANG_TAG = 'language';
39+
public const EXTLANG_TAG = 'extlang';
40+
public const SCRIPT_TAG = 'script';
41+
public const REGION_TAG = 'region';
42+
public const VARIANT_TAG = 'variant';
43+
public const GRANDFATHERED_LANG_TAG = 'grandfathered';
44+
public const PRIVATE_TAG = 'private';
4545

4646
/**
4747
* Not supported. Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616.

NumberFormatter/NumberFormatter.php

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -45,91 +45,91 @@
4545
abstract class NumberFormatter
4646
{
4747
/* Format style constants */
48-
const PATTERN_DECIMAL = 0;
49-
const DECIMAL = 1;
50-
const CURRENCY = 2;
51-
const PERCENT = 3;
52-
const SCIENTIFIC = 4;
53-
const SPELLOUT = 5;
54-
const ORDINAL = 6;
55-
const DURATION = 7;
56-
const PATTERN_RULEBASED = 9;
57-
const IGNORE = 0;
58-
const DEFAULT_STYLE = 1;
48+
public const PATTERN_DECIMAL = 0;
49+
public const DECIMAL = 1;
50+
public const CURRENCY = 2;
51+
public const PERCENT = 3;
52+
public const SCIENTIFIC = 4;
53+
public const SPELLOUT = 5;
54+
public const ORDINAL = 6;
55+
public const DURATION = 7;
56+
public const PATTERN_RULEBASED = 9;
57+
public const IGNORE = 0;
58+
public const DEFAULT_STYLE = 1;
5959

6060
/* Format type constants */
61-
const TYPE_DEFAULT = 0;
62-
const TYPE_INT32 = 1;
63-
const TYPE_INT64 = 2;
64-
const TYPE_DOUBLE = 3;
65-
const TYPE_CURRENCY = 4;
61+
public const TYPE_DEFAULT = 0;
62+
public const TYPE_INT32 = 1;
63+
public const TYPE_INT64 = 2;
64+
public const TYPE_DOUBLE = 3;
65+
public const TYPE_CURRENCY = 4;
6666

6767
/* Numeric attribute constants */
68-
const PARSE_INT_ONLY = 0;
69-
const GROUPING_USED = 1;
70-
const DECIMAL_ALWAYS_SHOWN = 2;
71-
const MAX_INTEGER_DIGITS = 3;
72-
const MIN_INTEGER_DIGITS = 4;
73-
const INTEGER_DIGITS = 5;
74-
const MAX_FRACTION_DIGITS = 6;
75-
const MIN_FRACTION_DIGITS = 7;
76-
const FRACTION_DIGITS = 8;
77-
const MULTIPLIER = 9;
78-
const GROUPING_SIZE = 10;
79-
const ROUNDING_MODE = 11;
80-
const ROUNDING_INCREMENT = 12;
81-
const FORMAT_WIDTH = 13;
82-
const PADDING_POSITION = 14;
83-
const SECONDARY_GROUPING_SIZE = 15;
84-
const SIGNIFICANT_DIGITS_USED = 16;
85-
const MIN_SIGNIFICANT_DIGITS = 17;
86-
const MAX_SIGNIFICANT_DIGITS = 18;
87-
const LENIENT_PARSE = 19;
68+
public const PARSE_INT_ONLY = 0;
69+
public const GROUPING_USED = 1;
70+
public const DECIMAL_ALWAYS_SHOWN = 2;
71+
public const MAX_INTEGER_DIGITS = 3;
72+
public const MIN_INTEGER_DIGITS = 4;
73+
public const INTEGER_DIGITS = 5;
74+
public const MAX_FRACTION_DIGITS = 6;
75+
public const MIN_FRACTION_DIGITS = 7;
76+
public const FRACTION_DIGITS = 8;
77+
public const MULTIPLIER = 9;
78+
public const GROUPING_SIZE = 10;
79+
public const ROUNDING_MODE = 11;
80+
public const ROUNDING_INCREMENT = 12;
81+
public const FORMAT_WIDTH = 13;
82+
public const PADDING_POSITION = 14;
83+
public const SECONDARY_GROUPING_SIZE = 15;
84+
public const SIGNIFICANT_DIGITS_USED = 16;
85+
public const MIN_SIGNIFICANT_DIGITS = 17;
86+
public const MAX_SIGNIFICANT_DIGITS = 18;
87+
public const LENIENT_PARSE = 19;
8888

8989
/* Text attribute constants */
90-
const POSITIVE_PREFIX = 0;
91-
const POSITIVE_SUFFIX = 1;
92-
const NEGATIVE_PREFIX = 2;
93-
const NEGATIVE_SUFFIX = 3;
94-
const PADDING_CHARACTER = 4;
95-
const CURRENCY_CODE = 5;
96-
const DEFAULT_RULESET = 6;
97-
const PUBLIC_RULESETS = 7;
90+
public const POSITIVE_PREFIX = 0;
91+
public const POSITIVE_SUFFIX = 1;
92+
public const NEGATIVE_PREFIX = 2;
93+
public const NEGATIVE_SUFFIX = 3;
94+
public const PADDING_CHARACTER = 4;
95+
public const CURRENCY_CODE = 5;
96+
public const DEFAULT_RULESET = 6;
97+
public const PUBLIC_RULESETS = 7;
9898

9999
/* Format symbol constants */
100-
const DECIMAL_SEPARATOR_SYMBOL = 0;
101-
const GROUPING_SEPARATOR_SYMBOL = 1;
102-
const PATTERN_SEPARATOR_SYMBOL = 2;
103-
const PERCENT_SYMBOL = 3;
104-
const ZERO_DIGIT_SYMBOL = 4;
105-
const DIGIT_SYMBOL = 5;
106-
const MINUS_SIGN_SYMBOL = 6;
107-
const PLUS_SIGN_SYMBOL = 7;
108-
const CURRENCY_SYMBOL = 8;
109-
const INTL_CURRENCY_SYMBOL = 9;
110-
const MONETARY_SEPARATOR_SYMBOL = 10;
111-
const EXPONENTIAL_SYMBOL = 11;
112-
const PERMILL_SYMBOL = 12;
113-
const PAD_ESCAPE_SYMBOL = 13;
114-
const INFINITY_SYMBOL = 14;
115-
const NAN_SYMBOL = 15;
116-
const SIGNIFICANT_DIGIT_SYMBOL = 16;
117-
const MONETARY_GROUPING_SEPARATOR_SYMBOL = 17;
100+
public const DECIMAL_SEPARATOR_SYMBOL = 0;
101+
public const GROUPING_SEPARATOR_SYMBOL = 1;
102+
public const PATTERN_SEPARATOR_SYMBOL = 2;
103+
public const PERCENT_SYMBOL = 3;
104+
public const ZERO_DIGIT_SYMBOL = 4;
105+
public const DIGIT_SYMBOL = 5;
106+
public const MINUS_SIGN_SYMBOL = 6;
107+
public const PLUS_SIGN_SYMBOL = 7;
108+
public const CURRENCY_SYMBOL = 8;
109+
public const INTL_CURRENCY_SYMBOL = 9;
110+
public const MONETARY_SEPARATOR_SYMBOL = 10;
111+
public const EXPONENTIAL_SYMBOL = 11;
112+
public const PERMILL_SYMBOL = 12;
113+
public const PAD_ESCAPE_SYMBOL = 13;
114+
public const INFINITY_SYMBOL = 14;
115+
public const NAN_SYMBOL = 15;
116+
public const SIGNIFICANT_DIGIT_SYMBOL = 16;
117+
public const MONETARY_GROUPING_SEPARATOR_SYMBOL = 17;
118118

119119
/* Rounding mode values used by NumberFormatter::setAttribute() with NumberFormatter::ROUNDING_MODE attribute */
120-
const ROUND_CEILING = 0;
121-
const ROUND_FLOOR = 1;
122-
const ROUND_DOWN = 2;
123-
const ROUND_UP = 3;
124-
const ROUND_HALFEVEN = 4;
125-
const ROUND_HALFDOWN = 5;
126-
const ROUND_HALFUP = 6;
120+
public const ROUND_CEILING = 0;
121+
public const ROUND_FLOOR = 1;
122+
public const ROUND_DOWN = 2;
123+
public const ROUND_UP = 3;
124+
public const ROUND_HALFEVEN = 4;
125+
public const ROUND_HALFDOWN = 5;
126+
public const ROUND_HALFUP = 6;
127127

128128
/* Pad position values used by NumberFormatter::setAttribute() with NumberFormatter::PADDING_POSITION attribute */
129-
const PAD_BEFORE_PREFIX = 0;
130-
const PAD_AFTER_PREFIX = 1;
131-
const PAD_BEFORE_SUFFIX = 2;
132-
const PAD_AFTER_SUFFIX = 3;
129+
public const PAD_BEFORE_PREFIX = 0;
130+
public const PAD_AFTER_PREFIX = 1;
131+
public const PAD_BEFORE_SUFFIX = 2;
132+
public const PAD_AFTER_SUFFIX = 3;
133133

134134
/**
135135
* The error code from the last operation.

0 commit comments

Comments
 (0)