• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CodeIgniter / coding-standard / 5863490589

pending completion
5863490589

push

github

paulbalandan
Specify force option for `php_unit_data_provider_static` fixer

1 of 1 new or added line in 1 file covered. (100.0%)

617 of 617 relevant lines covered (100.0%)

12.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/CodeIgniter4.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) 2021 CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace CodeIgniter\CodingStandard;
15

16
use Nexus\CsConfig\Ruleset\AbstractRuleset;
17

18
/**
19
 * Defines the ruleset used for the CodeIgniter4 organization.
20
 *
21
 * {@internal Use of this class is not covered by the backward compatibility promise for CodeIgniter4.}
22
 */
23
final class CodeIgniter4 extends AbstractRuleset
24
{
25
    public function __construct()
26
    {
27
        $this->name = 'CodeIgniter4 Coding Standards';
12✔
28

29
        $this->rules = [
12✔
30
            'align_multiline_comment'                  => ['comment_type' => 'phpdocs_only'],
12✔
31
            'array_indentation'                        => true,
12✔
32
            'array_push'                               => true,
12✔
33
            'array_syntax'                             => ['syntax' => 'short'],
12✔
34
            'assign_null_coalescing_to_coalesce_equal' => true,
12✔
35
            'backtick_to_shell_exec'                   => true,
12✔
36
            'binary_operator_spaces'                   => [
12✔
37
                'default'   => 'single_space',
12✔
38
                'operators' => [
12✔
39
                    '='  => 'align_single_space_minimal',
12✔
40
                    '=>' => 'align_single_space_minimal',
12✔
41
                    '||' => 'align_single_space_minimal',
12✔
42
                    '.=' => 'align_single_space_minimal',
12✔
43
                ],
12✔
44
            ],
12✔
45
            'blank_line_after_namespace'   => true,
12✔
46
            'blank_line_after_opening_tag' => true,
12✔
47
            'blank_line_before_statement'  => [
12✔
48
                'statements' => [
12✔
49
                    'case',
12✔
50
                    'continue',
12✔
51
                    'declare',
12✔
52
                    'default',
12✔
53
                    'do',
12✔
54
                    'exit',
12✔
55
                    'for',
12✔
56
                    'foreach',
12✔
57
                    'goto',
12✔
58
                    'return',
12✔
59
                    'switch',
12✔
60
                    'throw',
12✔
61
                    'try',
12✔
62
                    'while',
12✔
63
                    'yield',
12✔
64
                    'yield_from',
12✔
65
                ],
12✔
66
            ],
12✔
67
            'blank_line_between_import_groups' => true,
12✔
68
            'blank_lines_before_namespace'     => [
12✔
69
                'min_line_breaks' => 2,
12✔
70
                'max_line_breaks' => 2,
12✔
71
            ],
12✔
72
            'cast_spaces'                 => ['space' => 'single'],
12✔
73
            'class_attributes_separation' => [
12✔
74
                'elements' => [
12✔
75
                    'const'        => 'none',
12✔
76
                    'property'     => 'none',
12✔
77
                    'method'       => 'one',
12✔
78
                    'trait_import' => 'none',
12✔
79
                ],
12✔
80
            ],
12✔
81
            'class_definition' => [
12✔
82
                'multi_line_extends_each_single_line' => true,
12✔
83
                'single_item_single_line'             => true,
12✔
84
                'single_line'                         => true,
12✔
85
                'space_before_parenthesis'            => true,
12✔
86
                'inline_constructor_arguments'        => true,
12✔
87
            ],
12✔
88
            'class_reference_name_casing' => true,
12✔
89
            'clean_namespace'             => true,
12✔
90
            'combine_consecutive_issets'  => true,
12✔
91
            'combine_consecutive_unsets'  => true,
12✔
92
            'combine_nested_dirname'      => true,
12✔
93
            'comment_to_phpdoc'           => [
12✔
94
                'ignored_tags' => [
12✔
95
                    'todo',
12✔
96
                    'codeCoverageIgnore',
12✔
97
                    'codeCoverageIgnoreStart',
12✔
98
                    'codeCoverageIgnoreEnd',
12✔
99
                    'phpstan-ignore-line',
12✔
100
                    'phpstan-ignore-next-line',
12✔
101
                ],
12✔
102
            ],
12✔
103
            'compact_nullable_typehint'               => true,
12✔
104
            'concat_space'                            => ['spacing' => 'one'],
12✔
105
            'constant_case'                           => ['case' => 'lower'],
12✔
106
            'control_structure_braces'                => true,
12✔
107
            'control_structure_continuation_position' => ['position' => 'same_line'],
12✔
108
            'curly_braces_position'                   => [
12✔
109
                'control_structures_opening_brace'          => 'same_line',
12✔
110
                'functions_opening_brace'                   => 'next_line_unless_newline_at_signature_end',
12✔
111
                'anonymous_functions_opening_brace'         => 'same_line',
12✔
112
                'classes_opening_brace'                     => 'next_line_unless_newline_at_signature_end',
12✔
113
                'anonymous_classes_opening_brace'           => 'same_line',
12✔
114
                'allow_single_line_empty_anonymous_classes' => true,
12✔
115
                'allow_single_line_anonymous_functions'     => true,
12✔
116
            ],
12✔
117
            'date_time_create_from_format_call'    => true,
12✔
118
            'date_time_immutable'                  => false,
12✔
119
            'declare_equal_normalize'              => ['space' => 'none'],
12✔
120
            'declare_parentheses'                  => true,
12✔
121
            'declare_strict_types'                 => false,
12✔
122
            'dir_constant'                         => true,
12✔
123
            'doctrine_annotation_array_assignment' => false,
12✔
124
            'doctrine_annotation_braces'           => false,
12✔
125
            'doctrine_annotation_indentation'      => false,
12✔
126
            'doctrine_annotation_spaces'           => false,
12✔
127
            'echo_tag_syntax'                      => [
12✔
128
                'format'                         => 'short',
12✔
129
                'long_function'                  => 'echo',
12✔
130
                'shorten_simple_statements_only' => false,
12✔
131
            ],
12✔
132
            'elseif'               => true,
12✔
133
            'empty_loop_body'      => ['style' => 'braces'],
12✔
134
            'empty_loop_condition' => ['style' => 'while'],
12✔
135
            'encoding'             => true,
12✔
136
            'ereg_to_preg'         => true,
12✔
137
            'error_suppression'    => [
12✔
138
                'mute_deprecation_error'         => true,
12✔
139
                'noise_remaining_usages'         => false,
12✔
140
                'noise_remaining_usages_exclude' => [],
12✔
141
            ],
12✔
142
            'escape_implicit_backslashes' => [
12✔
143
                'double_quoted'  => true,
12✔
144
                'heredoc_syntax' => true,
12✔
145
                'single_quoted'  => false,
12✔
146
            ],
12✔
147
            'explicit_indirect_variable' => true,
12✔
148
            'explicit_string_variable'   => true,
12✔
149
            'final_class'                => false,
12✔
150
            'final_internal_class'       => [
12✔
151
                'exclude'                                    => ['no-final'],
12✔
152
                'include'                                    => ['internal'],
12✔
153
                'consider_absent_docblock_as_internal_class' => false,
12✔
154
            ],
12✔
155
            'final_public_method_for_abstract_class' => false,
12✔
156
            'fopen_flag_order'                       => true,
12✔
157
            'fopen_flags'                            => ['b_mode' => true],
12✔
158
            'full_opening_tag'                       => true,
12✔
159
            'fully_qualified_strict_types'           => true,
12✔
160
            'function_declaration'                   => [
12✔
161
                'closure_function_spacing'   => 'one',
12✔
162
                'closure_fn_spacing'         => 'one',
12✔
163
                'trailing_comma_single_line' => false,
12✔
164
            ],
12✔
165
            'function_to_constant' => [
12✔
166
                'functions' => [
12✔
167
                    'get_called_class',
12✔
168
                    'get_class',
12✔
169
                    'get_class_this',
12✔
170
                    'php_sapi_name',
12✔
171
                    'phpversion',
12✔
172
                    'pi',
12✔
173
                ],
12✔
174
            ],
12✔
175
            'general_phpdoc_annotation_remove' => [
12✔
176
                'annotations' => [
12✔
177
                    'author',
12✔
178
                    'package',
12✔
179
                    'subpackage',
12✔
180
                ],
12✔
181
                'case_sensitive' => false,
12✔
182
            ],
12✔
183
            'general_phpdoc_tag_rename' => [
12✔
184
                'case_sensitive' => false,
12✔
185
                'fix_annotation' => true,
12✔
186
                'fix_inline'     => true,
12✔
187
                'replacements'   => ['inheritDocs' => 'inheritDoc'],
12✔
188
            ],
12✔
189
            'get_class_to_class_keyword' => false,
12✔
190
            'global_namespace_import'    => [
12✔
191
                'import_constants' => false,
12✔
192
                'import_functions' => false,
12✔
193
                'import_classes'   => true,
12✔
194
            ],
12✔
195
            'group_import'                => false,
12✔
196
            'header_comment'              => false, // false by default
12✔
197
            'heredoc_indentation'         => ['indentation' => 'start_plus_one'],
12✔
198
            'heredoc_to_nowdoc'           => true,
12✔
199
            'implode_call'                => true,
12✔
200
            'include'                     => true,
12✔
201
            'increment_style'             => ['style' => 'post'],
12✔
202
            'indentation_type'            => true,
12✔
203
            'integer_literal_case'        => true,
12✔
204
            'is_null'                     => true,
12✔
205
            'lambda_not_used_import'      => true,
12✔
206
            'line_ending'                 => true,
12✔
207
            'linebreak_after_opening_tag' => true,
12✔
208
            'list_syntax'                 => ['syntax' => 'short'],
12✔
209
            'logical_operators'           => true,
12✔
210
            'lowercase_cast'              => true,
12✔
211
            'lowercase_keywords'          => true,
12✔
212
            'lowercase_static_reference'  => true,
12✔
213
            'magic_constant_casing'       => true,
12✔
214
            'magic_method_casing'         => true,
12✔
215
            'mb_str_functions'            => false,
12✔
216
            'method_argument_space'       => [
12✔
217
                'after_heredoc'                    => false,
12✔
218
                'keep_multiple_spaces_after_comma' => false,
12✔
219
                'on_multiline'                     => 'ensure_fully_multiline',
12✔
220
            ],
12✔
221
            'method_chaining_indentation'             => true,
12✔
222
            'modernize_strpos'                        => false, // requires 8.0+
12✔
223
            'modernize_types_casting'                 => true,
12✔
224
            'multiline_comment_opening_closing'       => true,
12✔
225
            'multiline_whitespace_before_semicolons'  => ['strategy' => 'no_multi_line'],
12✔
226
            'native_constant_invocation'              => false,
12✔
227
            'native_function_casing'                  => true,
12✔
228
            'native_function_invocation'              => false,
12✔
229
            'native_function_type_declaration_casing' => true,
12✔
230
            'new_with_braces'                         => [
12✔
231
                'named_class'     => true,
12✔
232
                'anonymous_class' => true,
12✔
233
            ],
12✔
234
            'no_alias_functions'                 => ['sets' => ['@all']],
12✔
235
            'no_alias_language_construct_call'   => true,
12✔
236
            'no_alternative_syntax'              => ['fix_non_monolithic_code' => false],
12✔
237
            'no_binary_string'                   => true,
12✔
238
            'no_blank_lines_after_class_opening' => true,
12✔
239
            'no_blank_lines_after_phpdoc'        => true,
12✔
240
            'no_break_comment'                   => ['comment_text' => 'no break'],
12✔
241
            'no_closing_tag'                     => true,
12✔
242
            'no_empty_comment'                   => true,
12✔
243
            'no_empty_phpdoc'                    => true,
12✔
244
            'no_empty_statement'                 => true,
12✔
245
            'no_extra_blank_lines'               => [
12✔
246
                'tokens' => [
12✔
247
                    'attribute',
12✔
248
                    'break',
12✔
249
                    'case',
12✔
250
                    'continue',
12✔
251
                    'curly_brace_block',
12✔
252
                    'default',
12✔
253
                    'extra',
12✔
254
                    'parenthesis_brace_block',
12✔
255
                    'return',
12✔
256
                    'square_brace_block',
12✔
257
                    'switch',
12✔
258
                    'throw',
12✔
259
                    'use',
12✔
260
                ],
12✔
261
            ],
12✔
262
            'no_homoglyph_names'                          => true,
12✔
263
            'no_leading_import_slash'                     => true,
12✔
264
            'no_leading_namespace_whitespace'             => true,
12✔
265
            'no_mixed_echo_print'                         => ['use' => 'echo'],
12✔
266
            'no_multiline_whitespace_around_double_arrow' => true,
12✔
267
            'no_multiple_statements_per_line'             => true,
12✔
268
            'no_null_property_initialization'             => true,
12✔
269
            'no_php4_constructor'                         => true,
12✔
270
            'no_short_bool_cast'                          => true,
12✔
271
            'no_singleline_whitespace_before_semicolons'  => true,
12✔
272
            'no_space_around_double_colon'                => true,
12✔
273
            'no_spaces_after_function_name'               => true,
12✔
274
            'no_spaces_around_offset'                     => ['positions' => ['inside', 'outside']],
12✔
275
            'no_superfluous_elseif'                       => true,
12✔
276
            'no_superfluous_phpdoc_tags'                  => [
12✔
277
                'allow_mixed'         => true,
12✔
278
                'allow_unused_params' => true,
12✔
279
                'remove_inheritdoc'   => false,
12✔
280
            ],
12✔
281
            'no_trailing_comma_in_singleline' => [
12✔
282
                'elements' => [
12✔
283
                    'arguments',
12✔
284
                    'array_destructuring',
12✔
285
                    'array',
12✔
286
                    'group_import',
12✔
287
                ],
12✔
288
            ],
12✔
289
            'no_trailing_whitespace'            => true,
12✔
290
            'no_trailing_whitespace_in_comment' => true,
12✔
291
            'no_trailing_whitespace_in_string'  => true,
12✔
292
            'no_unneeded_control_parentheses'   => [
12✔
293
                'statements' => [
12✔
294
                    'break',
12✔
295
                    'clone',
12✔
296
                    'continue',
12✔
297
                    'echo_print',
12✔
298
                    'return',
12✔
299
                    'switch_case',
12✔
300
                    'yield',
12✔
301
                ],
12✔
302
            ],
12✔
303
            'no_unneeded_curly_braces'                         => ['namespaces' => true],
12✔
304
            'no_unneeded_final_method'                         => ['private_methods' => true],
12✔
305
            'no_unneeded_import_alias'                         => true,
12✔
306
            'no_unreachable_default_argument_value'            => true,
12✔
307
            'no_unset_cast'                                    => true,
12✔
308
            'no_unset_on_property'                             => false,
12✔
309
            'no_unused_imports'                                => true,
12✔
310
            'no_useless_concat_operator'                       => ['juggle_simple_strings' => true],
12✔
311
            'no_useless_else'                                  => true,
12✔
312
            'no_useless_nullsafe_operator'                     => true,
12✔
313
            'no_useless_return'                                => true,
12✔
314
            'no_useless_sprintf'                               => true,
12✔
315
            'no_whitespace_before_comma_in_array'              => ['after_heredoc' => true],
12✔
316
            'no_whitespace_in_blank_line'                      => true,
12✔
317
            'non_printable_character'                          => ['use_escape_sequences_in_strings' => true],
12✔
318
            'normalize_index_brace'                            => true,
12✔
319
            'not_operator_with_space'                          => false,
12✔
320
            'not_operator_with_successor_space'                => true,
12✔
321
            'nullable_type_declaration'                        => false, // requires 8.0+
12✔
322
            'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
12✔
323
            'object_operator_without_whitespace'               => true,
12✔
324
            'octal_notation'                                   => false, // requires 8.1+
12✔
325
            'operator_linebreak'                               => ['only_booleans' => true, 'position' => 'beginning'],
12✔
326
            'ordered_class_elements'                           => [
12✔
327
                'order' => [
12✔
328
                    'use_trait',
12✔
329
                    'constant',
12✔
330
                    'property',
12✔
331
                    'method',
12✔
332
                ],
12✔
333
                'sort_algorithm' => 'none',
12✔
334
                'case_sensitive' => false,
12✔
335
            ],
12✔
336
            'ordered_imports' => [
12✔
337
                'sort_algorithm' => 'alpha',
12✔
338
                'imports_order'  => ['class', 'function', 'const'],
12✔
339
            ],
12✔
340
            'ordered_interfaces' => false,
12✔
341
            'ordered_traits'     => false,
12✔
342
            'ordered_types'      => false, // requires 8.0+
12✔
343
            'php_unit_construct' => [
12✔
344
                'assertions' => [
12✔
345
                    'assertSame',
12✔
346
                    'assertEquals',
12✔
347
                    'assertNotEquals',
12✔
348
                    'assertNotSame',
12✔
349
                ],
12✔
350
            ],
12✔
351
            'php_unit_data_provider_name' => [
12✔
352
                'prefix' => 'provide',
12✔
353
                'suffix' => '',
12✔
354
            ],
12✔
355
            'php_unit_data_provider_return_type'     => true,
12✔
356
            'php_unit_data_provider_static'          => ['force' => true],
12✔
357
            'php_unit_dedicate_assert'               => ['target' => 'newest'],
12✔
358
            'php_unit_dedicate_assert_internal_type' => ['target' => 'newest'],
12✔
359
            'php_unit_expectation'                   => ['target' => 'newest'],
12✔
360
            'php_unit_fqcn_annotation'               => true,
12✔
361
            'php_unit_internal_class'                => ['types' => ['normal', 'final']],
12✔
362
            'php_unit_method_casing'                 => ['case' => 'camel_case'],
12✔
363
            'php_unit_mock'                          => ['target' => 'newest'],
12✔
364
            'php_unit_mock_short_will_return'        => true,
12✔
365
            'php_unit_namespaced'                    => ['target' => 'newest'],
12✔
366
            'php_unit_no_expectation_annotation'     => [
12✔
367
                'target'          => 'newest',
12✔
368
                'use_class_const' => true,
12✔
369
            ],
12✔
370
            'php_unit_set_up_tear_down_visibility' => true,
12✔
371
            'php_unit_size_class'                  => false,
12✔
372
            'php_unit_strict'                      => [
12✔
373
                'assertions' => [
12✔
374
                    'assertAttributeEquals',
12✔
375
                    'assertAttributeNotEquals',
12✔
376
                    'assertEquals',
12✔
377
                    'assertNotEquals',
12✔
378
                ],
12✔
379
            ],
12✔
380
            'php_unit_test_annotation'               => ['style' => 'prefix'],
12✔
381
            'php_unit_test_case_static_method_calls' => [
12✔
382
                'call_type' => 'this',
12✔
383
                'methods'   => [],
12✔
384
            ],
12✔
385
            'php_unit_test_class_requires_covers' => false,
12✔
386
            'phpdoc_add_missing_param_annotation' => ['only_untyped' => true],
12✔
387
            'phpdoc_align'                        => [
12✔
388
                'align' => 'vertical',
12✔
389
                'tags'  => [
12✔
390
                    'method',
12✔
391
                    'param',
12✔
392
                    'property',
12✔
393
                    'return',
12✔
394
                    'throws',
12✔
395
                    'type',
12✔
396
                    'var',
12✔
397
                ],
12✔
398
            ],
12✔
399
            'phpdoc_annotation_without_dot' => false,
12✔
400
            'phpdoc_indent'                 => true,
12✔
401
            'phpdoc_inline_tag_normalizer'  => [
12✔
402
                'tags' => [
12✔
403
                    'example',
12✔
404
                    'id',
12✔
405
                    'internal',
12✔
406
                    'inheritdoc',
12✔
407
                    'inheritdocs',
12✔
408
                    'link',
12✔
409
                    'source',
12✔
410
                    'toc',
12✔
411
                    'tutorial',
12✔
412
                ],
12✔
413
            ],
12✔
414
            'phpdoc_line_span' => [
12✔
415
                'const'    => 'multi',
12✔
416
                'method'   => 'multi',
12✔
417
                'property' => 'multi',
12✔
418
            ],
12✔
419
            'phpdoc_no_access'    => true,
12✔
420
            'phpdoc_no_alias_tag' => [
12✔
421
                'replacements' => [
12✔
422
                    'property-read'  => 'property',
12✔
423
                    'property-write' => 'property',
12✔
424
                    'type'           => 'var',
12✔
425
                    'link'           => 'see',
12✔
426
                ],
12✔
427
            ],
12✔
428
            'phpdoc_no_empty_return'       => false,
12✔
429
            'phpdoc_no_package'            => true,
12✔
430
            'phpdoc_no_useless_inheritdoc' => true,
12✔
431
            'phpdoc_order'                 => [
12✔
432
                'order' => ['param', 'return', 'throws'],
12✔
433
            ],
12✔
434
            'phpdoc_order_by_value' => [
12✔
435
                'annotations' => [
12✔
436
                    'author',
12✔
437
                    'covers',
12✔
438
                    'coversNothing',
12✔
439
                    'dataProvider',
12✔
440
                    'depends',
12✔
441
                    'group',
12✔
442
                    'internal',
12✔
443
                    'method',
12✔
444
                    'property',
12✔
445
                    'property-read',
12✔
446
                    'property-write',
12✔
447
                    'requires',
12✔
448
                    'throws',
12✔
449
                    'uses',
12✔
450
                ],
12✔
451
            ],
12✔
452
            'phpdoc_param_order'           => false,
12✔
453
            'phpdoc_return_self_reference' => [
12✔
454
                'replacements' => [
12✔
455
                    'this'    => '$this',
12✔
456
                    '@this'   => '$this',
12✔
457
                    '$self'   => 'self',
12✔
458
                    '@self'   => 'self',
12✔
459
                    '$static' => 'static',
12✔
460
                    '@static' => 'static',
12✔
461
                ],
12✔
462
            ],
12✔
463
            'phpdoc_scalar' => [
12✔
464
                'types' => [
12✔
465
                    'boolean',
12✔
466
                    'callback',
12✔
467
                    'double',
12✔
468
                    'integer',
12✔
469
                    'real',
12✔
470
                    'str',
12✔
471
                ],
12✔
472
            ],
12✔
473
            'phpdoc_separation' => [
12✔
474
                'groups' => [
12✔
475
                    ['immutable', 'psalm-immutable'],
12✔
476
                    ['param', 'phpstan-param', 'psalm-param'],
12✔
477
                    ['phpstan-pure', 'psalm-pure'],
12✔
478
                    ['readonly', 'psalm-readonly'],
12✔
479
                    ['return', 'phpstan-return', 'psalm-return'],
12✔
480
                    ['runTestsInSeparateProcess', 'runInSeparateProcess', 'preserveGlobalState'],
12✔
481
                    ['template', 'phpstan-template', 'psalm-template'],
12✔
482
                    ['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
12✔
483
                    ['phpstan-type', 'psalm-type'],
12✔
484
                    ['var', 'phpstan-var', 'psalm-var'],
12✔
485
                ],
12✔
486
                'skip_unlisted_annotations' => true,
12✔
487
            ],
12✔
488
            'phpdoc_single_line_var_spacing'                => true,
12✔
489
            'phpdoc_summary'                                => false,
12✔
490
            'phpdoc_tag_casing'                             => ['tags' => ['inheritDoc']],
12✔
491
            'phpdoc_tag_type'                               => ['tags' => ['inheritDoc' => 'inline']],
12✔
492
            'phpdoc_to_comment'                             => false,
12✔
493
            'phpdoc_to_param_type'                          => false,
12✔
494
            'phpdoc_to_property_type'                       => false,
12✔
495
            'phpdoc_to_return_type'                         => false,
12✔
496
            'phpdoc_trim'                                   => true,
12✔
497
            'phpdoc_trim_consecutive_blank_line_separation' => true,
12✔
498
            'phpdoc_types'                                  => ['groups' => ['simple', 'alias', 'meta']],
12✔
499
            'phpdoc_types_order'                            => [
12✔
500
                'null_adjustment' => 'always_last',
12✔
501
                'sort_algorithm'  => 'alpha',
12✔
502
            ],
12✔
503
            'phpdoc_var_annotation_correct_order' => true,
12✔
504
            'phpdoc_var_without_name'             => true,
12✔
505
            'pow_to_exponentiation'               => true,
12✔
506
            'protected_to_private'                => true,
12✔
507
            'psr_autoloading'                     => ['dir' => null],
12✔
508
            'random_api_migration'                => [
12✔
509
                'replacements' => [
12✔
510
                    'getrandmax' => 'mt_getrandmax',
12✔
511
                    'rand'       => 'mt_rand',
12✔
512
                    'srand'      => 'mt_srand',
12✔
513
                ],
12✔
514
            ],
12✔
515
            'regular_callable_call'              => true,
12✔
516
            'return_assignment'                  => true,
12✔
517
            'return_to_yield_from'               => false,
12✔
518
            'return_type_declaration'            => ['space_before' => 'none'],
12✔
519
            'self_accessor'                      => false,
12✔
520
            'self_static_accessor'               => true,
12✔
521
            'semicolon_after_instruction'        => false,
12✔
522
            'set_type_to_cast'                   => true,
12✔
523
            'short_scalar_cast'                  => true,
12✔
524
            'simple_to_complex_string_variable'  => true,
12✔
525
            'simplified_if_return'               => true,
12✔
526
            'simplified_null_return'             => false,
12✔
527
            'single_blank_line_at_eof'           => true,
12✔
528
            'single_class_element_per_statement' => ['elements' => ['const', 'property']],
12✔
529
            'single_import_per_statement'        => ['group_to_single_imports' => true],
12✔
530
            'single_line_after_imports'          => true,
12✔
531
            'single_line_comment_spacing'        => true,
12✔
532
            'single_line_comment_style'          => ['comment_types' => ['asterisk', 'hash']],
12✔
533
            'single_line_empty_body'             => false,
12✔
534
            'single_line_throw'                  => false,
12✔
535
            'single_quote'                       => ['strings_containing_single_quote_chars' => false],
12✔
536
            'single_space_around_construct'      => [
12✔
537
                'constructs_contain_a_single_space'     => ['yield_from'],
12✔
538
                'constructs_preceded_by_a_single_space' => ['use_lambda'],
12✔
539
                'constructs_followed_by_a_single_space' => [
12✔
540
                    'abstract',
12✔
541
                    'as',
12✔
542
                    'attribute',
12✔
543
                    'break',
12✔
544
                    'case',
12✔
545
                    'catch',
12✔
546
                    'class',
12✔
547
                    'clone',
12✔
548
                    'comment',
12✔
549
                    'const',
12✔
550
                    'const_import',
12✔
551
                    'continue',
12✔
552
                    'do',
12✔
553
                    'echo',
12✔
554
                    'else',
12✔
555
                    'elseif',
12✔
556
                    'enum',
12✔
557
                    'extends',
12✔
558
                    'final',
12✔
559
                    'finally',
12✔
560
                    'for',
12✔
561
                    'foreach',
12✔
562
                    'function',
12✔
563
                    'function_import',
12✔
564
                    'global',
12✔
565
                    'goto',
12✔
566
                    'if',
12✔
567
                    'implements',
12✔
568
                    'include',
12✔
569
                    'include_once',
12✔
570
                    'instanceof',
12✔
571
                    'insteadof',
12✔
572
                    'interface',
12✔
573
                    'match',
12✔
574
                    'named_argument',
12✔
575
                    'namespace',
12✔
576
                    'new',
12✔
577
                    'open_tag_with_echo',
12✔
578
                    'php_doc',
12✔
579
                    'php_open',
12✔
580
                    'print',
12✔
581
                    'private',
12✔
582
                    'protected',
12✔
583
                    'public',
12✔
584
                    'readonly',
12✔
585
                    'require',
12✔
586
                    'require_once',
12✔
587
                    'return',
12✔
588
                    'static',
12✔
589
                    'switch',
12✔
590
                    'throw',
12✔
591
                    'trait',
12✔
592
                    'try',
12✔
593
                    'type_colon',
12✔
594
                    'use',
12✔
595
                    'use_lambda',
12✔
596
                    'use_trait',
12✔
597
                    'var',
12✔
598
                    'while',
12✔
599
                    'yield',
12✔
600
                    'yield_from',
12✔
601
                ],
12✔
602
            ],
12✔
603
            'single_trait_insert_per_statement' => true,
12✔
604
            'space_after_semicolon'             => ['remove_in_empty_for_expressions' => true],
12✔
605
            'spaces_inside_parentheses'         => ['space' => 'none'],
12✔
606
            'standardize_increment'             => true,
12✔
607
            'standardize_not_equals'            => true,
12✔
608
            'statement_indentation'             => true,
12✔
609
            'static_lambda'                     => true,
12✔
610
            'strict_comparison'                 => true,
12✔
611
            'strict_param'                      => true,
12✔
612
            'string_length_to_empty'            => true,
12✔
613
            'string_line_ending'                => true,
12✔
614
            'switch_case_semicolon_to_colon'    => true,
12✔
615
            'switch_case_space'                 => true,
12✔
616
            'switch_continue_to_break'          => true,
12✔
617
            'ternary_operator_spaces'           => true,
12✔
618
            'ternary_to_elvis_operator'         => true,
12✔
619
            'ternary_to_null_coalescing'        => true,
12✔
620
            'trailing_comma_in_multiline'       => [
12✔
621
                'after_heredoc' => true,
12✔
622
                'elements'      => ['arrays'],
12✔
623
            ],
12✔
624
            'trim_array_spaces'       => true,
12✔
625
            'type_declaration_spaces' => ['elements' => ['function', 'property']],
12✔
626
            'types_spaces'            => [
12✔
627
                'space'                => 'none',
12✔
628
                'space_multiple_catch' => 'none',
12✔
629
            ],
12✔
630
            'unary_operator_spaces'           => true,
12✔
631
            'use_arrow_functions'             => true,
12✔
632
            'visibility_required'             => ['elements' => ['const', 'method', 'property']],
12✔
633
            'void_return'                     => false, // changes method signature
12✔
634
            'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
12✔
635
            'yield_from_array_to_yields'      => false,
12✔
636
            'yoda_style'                      => [
12✔
637
                'equal'                => false,
12✔
638
                'identical'            => null,
12✔
639
                'less_and_greater'     => false,
12✔
640
                'always_move_variable' => false,
12✔
641
            ],
12✔
642
        ];
12✔
643

644
        $this->requiredPHPVersion = 70400;
12✔
645

646
        $this->autoActivateIsRiskyAllowed = true;
12✔
647
    }
648
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc