Skip to content

Commit 2bd74df

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

9 files changed

+36
-36
lines changed

Encoder/CsvEncoder.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
*/
2323
class CsvEncoder implements EncoderInterface, DecoderInterface
2424
{
25-
const FORMAT = 'csv';
26-
const DELIMITER_KEY = 'csv_delimiter';
27-
const ENCLOSURE_KEY = 'csv_enclosure';
28-
const ESCAPE_CHAR_KEY = 'csv_escape_char';
29-
const KEY_SEPARATOR_KEY = 'csv_key_separator';
30-
const HEADERS_KEY = 'csv_headers';
31-
const ESCAPE_FORMULAS_KEY = 'csv_escape_formulas';
32-
const AS_COLLECTION_KEY = 'as_collection';
33-
const NO_HEADERS_KEY = 'no_headers';
34-
const OUTPUT_UTF8_BOM_KEY = 'output_utf8_bom';
25+
public const FORMAT = 'csv';
26+
public const DELIMITER_KEY = 'csv_delimiter';
27+
public const ENCLOSURE_KEY = 'csv_enclosure';
28+
public const ESCAPE_CHAR_KEY = 'csv_escape_char';
29+
public const KEY_SEPARATOR_KEY = 'csv_key_separator';
30+
public const HEADERS_KEY = 'csv_headers';
31+
public const ESCAPE_FORMULAS_KEY = 'csv_escape_formulas';
32+
public const AS_COLLECTION_KEY = 'as_collection';
33+
public const NO_HEADERS_KEY = 'no_headers';
34+
public const OUTPUT_UTF8_BOM_KEY = 'output_utf8_bom';
3535

3636
private const UTF8_BOM = "\xEF\xBB\xBF";
3737

Encoder/JsonDecode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ class JsonDecode implements DecoderInterface
2525
/**
2626
* True to return the result as an associative array, false for a nested stdClass hierarchy.
2727
*/
28-
const ASSOCIATIVE = 'json_decode_associative';
28+
public const ASSOCIATIVE = 'json_decode_associative';
2929

30-
const OPTIONS = 'json_decode_options';
30+
public const OPTIONS = 'json_decode_options';
3131

3232
/**
3333
* Specifies the recursion depth.
3434
*/
35-
const RECURSION_DEPTH = 'json_decode_recursion_depth';
35+
public const RECURSION_DEPTH = 'json_decode_recursion_depth';
3636

3737
private $defaultContext = [
3838
self::ASSOCIATIVE => false,

Encoder/JsonEncode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class JsonEncode implements EncoderInterface
2222
{
23-
const OPTIONS = 'json_encode_options';
23+
public const OPTIONS = 'json_encode_options';
2424

2525
private $defaultContext = [
2626
self::OPTIONS => 0,

Encoder/JsonEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class JsonEncoder implements EncoderInterface, DecoderInterface
2020
{
21-
const FORMAT = 'json';
21+
public const FORMAT = 'json';
2222

2323
protected $encodingImpl;
2424
protected $decodingImpl;

Encoder/XmlEncoder.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,34 @@ class XmlEncoder implements EncoderInterface, DecoderInterface, NormalizationAwa
2929
{
3030
use SerializerAwareTrait;
3131

32-
const FORMAT = 'xml';
32+
public const FORMAT = 'xml';
3333

34-
const AS_COLLECTION = 'as_collection';
34+
public const AS_COLLECTION = 'as_collection';
3535

3636
/**
3737
* An array of ignored XML node types while decoding, each one of the DOM Predefined XML_* constants.
3838
*/
39-
const DECODER_IGNORED_NODE_TYPES = 'decoder_ignored_node_types';
39+
public const DECODER_IGNORED_NODE_TYPES = 'decoder_ignored_node_types';
4040

4141
/**
4242
* An array of ignored XML node types while encoding, each one of the DOM Predefined XML_* constants.
4343
*/
44-
const ENCODER_IGNORED_NODE_TYPES = 'encoder_ignored_node_types';
45-
const ENCODING = 'xml_encoding';
46-
const FORMAT_OUTPUT = 'xml_format_output';
44+
public const ENCODER_IGNORED_NODE_TYPES = 'encoder_ignored_node_types';
45+
public const ENCODING = 'xml_encoding';
46+
public const FORMAT_OUTPUT = 'xml_format_output';
4747

4848
/**
4949
* A bit field of LIBXML_* constants.
5050
*/
51-
const LOAD_OPTIONS = 'load_options';
52-
const REMOVE_EMPTY_TAGS = 'remove_empty_tags';
53-
const ROOT_NODE_NAME = 'xml_root_node_name';
54-
const STANDALONE = 'xml_standalone';
51+
public const LOAD_OPTIONS = 'load_options';
52+
public const REMOVE_EMPTY_TAGS = 'remove_empty_tags';
53+
public const ROOT_NODE_NAME = 'xml_root_node_name';
54+
public const STANDALONE = 'xml_standalone';
5555

5656
/** @deprecated The constant TYPE_CASE_ATTRIBUTES is deprecated since version 4.4 and will be removed in version 5. Use TYPE_CAST_ATTRIBUTES instead. */
57-
const TYPE_CASE_ATTRIBUTES = 'xml_type_cast_attributes';
58-
const TYPE_CAST_ATTRIBUTES = 'xml_type_cast_attributes';
59-
const VERSION = 'xml_version';
57+
public const TYPE_CASE_ATTRIBUTES = 'xml_type_cast_attributes';
58+
public const TYPE_CAST_ATTRIBUTES = 'xml_type_cast_attributes';
59+
public const VERSION = 'xml_version';
6060

6161
private $defaultContext = [
6262
self::AS_COLLECTION => false,

Encoder/YamlEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class YamlEncoder implements EncoderInterface, DecoderInterface
2525
{
26-
const FORMAT = 'yaml';
26+
public const FORMAT = 'yaml';
2727
private const ALTERNATIVE_FORMAT = 'yml';
2828

2929
public const PRESERVE_EMPTY_OBJECTS = 'preserve_empty_objects';

Normalizer/ConstraintViolationListNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
*/
2525
class ConstraintViolationListNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface
2626
{
27-
const INSTANCE = 'instance';
28-
const STATUS = 'status';
29-
const TITLE = 'title';
30-
const TYPE = 'type';
27+
public const INSTANCE = 'instance';
28+
public const STATUS = 'status';
29+
public const TITLE = 'title';
30+
public const TYPE = 'type';
3131

3232
private $defaultContext;
3333
private $nameConverter;

Normalizer/DateIntervalNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class DateIntervalNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface
2424
{
25-
const FORMAT_KEY = 'dateinterval_format';
25+
public const FORMAT_KEY = 'dateinterval_format';
2626

2727
private $defaultContext = [
2828
self::FORMAT_KEY => '%rP%yY%mM%dDT%hH%iM%sS',

Normalizer/DateTimeNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
*/
2323
class DateTimeNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface
2424
{
25-
const FORMAT_KEY = 'datetime_format';
26-
const TIMEZONE_KEY = 'datetime_timezone';
25+
public const FORMAT_KEY = 'datetime_format';
26+
public const TIMEZONE_KEY = 'datetime_timezone';
2727

2828
private $defaultContext;
2929

0 commit comments

Comments
 (0)