-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.php
More file actions
48 lines (42 loc) · 1.84 KB
/
rules.php
File metadata and controls
48 lines (42 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
return [
'@PSR2' => true,
'@PSR12' => true,
// IMPORTS
'ordered_imports' => [
'sort_algorithm' => 'alpha', //stricter PSR12 requirements
'imports_order' => ['class', 'function', 'const'] //PSR12
],
// CASTING
// A single space should be between cast and variable.
'cast_spaces' => ['space' => 'single'],
// @PSR12, cast should be written in lower case.
'lowercase_cast' => true,
//Short cast bool using double exclamation mark should not be used.
'no_short_bool_cast' => true,
// Variables must be set null instead of using (unset) casting.
'no_unset_cast' => true,
// @PSR12, cast (boolean), (integer), (double), (real) and (binary) as (bool), (int), (float) and (string).
'short_scalar_cast' => true,
// ARRAYS
// PHP arrays should be declared using the short syntax $arr = [].
'array_syntax' => ['syntax' => 'short'],
// Operator => should not be surrounded by multi-line whitespaces.
'no_multiline_whitespace_around_double_arrow' => true,
// In array declaration, there MUST NOT be a whitespace before each comma.
'no_whitespace_before_comma_in_array' => true,
// In array declaration, there MUST be exactly one whitespace after each comma.
'whitespace_after_comma_in_array' => true,
// Array index should always be written by using square braces.
'normalize_index_brace' => true,
// Arrays should be formatted like function/method arguments, without leading or trailing single line space.
'trim_array_spaces' => true,
// GENERAL FORMATTING
'object_operator_without_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'standardize_not_equals' => true,
'no_extra_blank_lines' => ['tokens' => ['extra']],
// PHPDOC
'php_unit_test_class_requires_covers' => true,
'no_empty_phpdoc' => true,
];