Skip to content

Commit 93be62b

Browse files
committed
Fix linting rules in ci
1 parent 31661f6 commit 93be62b

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
22
vendor/
3+
.php-cs-fixer.cache
34
.phpunit.result.cache
45
composer.lock

.php_cs renamed to .php-cs-fixer.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
->in(__DIR__ . '/src')
55
->in(__DIR__ . '/tests');
66

7-
return \PhpCsFixer\Config::create()
7+
return (new PhpCsFixer\Config())
88
->setRiskyAllowed(true)
99
->setRules([
10-
'@PSR2' => true,
10+
'@PSR12' => true,
1111

1212
'array_syntax' => [
1313
'syntax' => 'short'
1414
],
15-
'binary_operator_spaces' => [
16-
'align_double_arrow' => null,
17-
'align_equals' => false,
18-
],
15+
'binary_operator_spaces' => true,
1916
'blank_line_after_opening_tag' => true,
2017
'cast_spaces' => true,
18+
'class_attributes_separation' => ['elements' => ['method' => 'one']],
2119
'combine_consecutive_unsets' => true,
2220
'concat_space' => [
2321
'spacing' => 'one'
@@ -27,13 +25,12 @@
2725
'ereg_to_preg' => true,
2826
'function_to_constant' => true,
2927
'function_typehint_space' => true,
30-
'hash_to_slash_comment' => true,
3128
'heredoc_to_nowdoc' => true,
3229
'include' => true,
3330
'is_null' => true,
3431
'lowercase_cast' => true,
3532
'magic_constant_casing' => true,
36-
'method_separation' => true,
33+
'multiline_whitespace_before_semicolons' => true,
3734
'modernize_types_casting' => true,
3835
'native_function_casing' => true,
3936
'new_with_braces' => true,
@@ -43,12 +40,11 @@
4340
'no_empty_comment' => true,
4441
'no_empty_phpdoc' => true,
4542
'no_empty_statement' => true,
46-
'no_extra_consecutive_blank_lines' => true,
43+
'no_extra_blank_lines' => true,
4744
'no_leading_import_slash' => true,
4845
'no_leading_namespace_whitespace' => true,
4946
'no_mixed_echo_print' => true,
5047
'no_multiline_whitespace_around_double_arrow' => true,
51-
'no_multiline_whitespace_before_semicolons' => true,
5248
'no_php4_constructor' => true,
5349
'no_short_bool_cast' => true,
5450
'no_singleline_whitespace_before_semicolons' => true,
@@ -73,7 +69,7 @@
7369
'phpdoc_add_missing_param_annotation' => true,
7470
'phpdoc_annotation_without_dot' => true,
7571
'phpdoc_indent' => true,
76-
'phpdoc_inline_tag' => true,
72+
'phpdoc_inline_tag_normalizer' => true,
7773
'phpdoc_no_access' => true,
7874
'phpdoc_no_alias_tag' => true,
7975
'phpdoc_no_package' => true,
@@ -84,18 +80,19 @@
8480
'phpdoc_types' => true,
8581
'phpdoc_var_without_name' => true,
8682
'pow_to_exponentiation' => true,
87-
'psr4' => true,
83+
'psr_autoloading' => true,
8884
'return_type_declaration' => true,
8985
'self_accessor' => true,
9086
'short_scalar_cast' => true,
9187
'single_blank_line_before_namespace' => true,
88+
'single_line_comment_style' => true,
9289
'single_quote' => true,
9390
'space_after_semicolon' => true,
9491
'standardize_not_equals' => true,
9592
'strict_comparison' => true,
9693
'strict_param' => true,
9794
'ternary_operator_spaces' => true,
98-
'trailing_comma_in_multiline_array' => true,
95+
'trailing_comma_in_multiline' => true,
9996
'trim_array_spaces' => true,
10097
'whitespace_after_comma_in_array' => true,
10198
])

src/JsonToken.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@
1212
final class JsonToken
1313
{
1414
/** Represents the [ character that begins an array */
15-
const T_LEFT_BRACKET = 1;
15+
public const T_LEFT_BRACKET = 1;
1616

1717
/** Represents the ] character the ends an array */
18-
const T_RIGHT_BRACKET = 2;
18+
public const T_RIGHT_BRACKET = 2;
1919

2020
/** Represents the { character that begins an object */
21-
const T_LEFT_BRACE = 3;
21+
public const T_LEFT_BRACE = 3;
2222

2323
/** Represents the } character that ends an object */
24-
const T_RIGHT_BRACE = 4;
24+
public const T_RIGHT_BRACE = 4;
2525

2626
/** Represents a name in an object name/value pair */
27-
const T_NAME = 5;
27+
public const T_NAME = 5;
2828

2929
/** Represent the : character that separates a name and a value */
30-
const T_COLON = 6;
30+
public const T_COLON = 6;
3131

3232
/** Represents all values */
33-
const T_VALUE = 7;
33+
public const T_VALUE = 7;
3434

3535
/** Represents the , character that separates array values and object name/value pairs */
36-
const T_COMMA = 8;
36+
public const T_COMMA = 8;
3737

3838
/** Represents all whitespace */
39-
const T_WHITESPACE = 9;
39+
public const T_WHITESPACE = 9;
4040
}

0 commit comments

Comments
 (0)