Completed
Pull Request — master (#56)
by Robin
07:16
created

Fixers::getPresets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 14 and the first side effect is on line 5.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace SLLH\StyleCIBridge\StyleCI;
4
5
@trigger_error('The '.__NAMESPACE__.'\Fixers class is deprecated since 1.4 and will be removed in 2.0. Use SLLH\StyleCIFixers\Fixers instead.', E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 163 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
6
7
/**
8
 * This class was auto-generated from StyleCI/Config repository.
9
 *
10
 * @link https://github.com/StyleCI/Config/blob/master/src/Config.php
11
 *
12
 * @deprecated since 1.4, will be removed in 2.0.
13
 */
14
class Fixers
0 ignored issues
show
Coding Style introduced by
Fixers does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
15
{
16
    /**
17
     * @var string[]
18
     */
19
    public static $valid = array(
20
        'alias_functions',
21
        'align_double_arrow',
22
        'align_equals',
23
        'blankline_after_open_tag',
24
        'braces',
25
        'concat_without_spaces',
26
        'concat_with_spaces',
27
        'double_arrow_multiline_whitespaces',
28
        'duplicate_semicolon',
29
        'elseif',
30
        'empty_return',
31
        'encoding',
32
        'eof_ending',
33
        'ereg_to_preg',
34
        'extra_empty_lines',
35
        'function_call_space',
36
        'function_declaration',
37
        'function_typehint_space',
38
        'include',
39
        'indentation',
40
        'linefeed',
41
        'line_after_namespace',
42
        'list_commas',
43
        'logical_not_operators_with_spaces',
44
        'logical_not_operators_with_successor_space',
45
        'long_array_syntax',
46
        'lowercase_constants',
47
        'lowercase_keywords',
48
        'method_argument_space',
49
        'method_separation',
50
        'multiline_array_trailing_comma',
51
        'multiline_spaces_before_semicolon',
52
        'multiple_use',
53
        'namespace_no_leading_whitespace',
54
        'newline_after_open_tag',
55
        'new_with_braces',
56
        'no_blank_lines_after_class_opening',
57
        'no_blank_lines_before_namespace',
58
        'no_empty_lines_after_phpdocs',
59
        'object_operator',
60
        'operators_spaces',
61
        'ordered_use',
62
        'parenthesis',
63
        'php4_constructor',
64
        'phpdoc_align',
65
        'phpdoc_indent',
66
        'phpdoc_inline_tag',
67
        'phpdoc_no_access',
68
        'phpdoc_no_empty_return',
69
        'phpdoc_no_package',
70
        'phpdoc_order',
71
        'phpdoc_scalar',
72
        'phpdoc_separation',
73
        'phpdoc_short_description',
74
        'phpdoc_to_comment',
75
        'phpdoc_trim',
76
        'phpdoc_type_to_var',
77
        'phpdoc_types',
78
        'phpdoc_var_to_type',
79
        'phpdoc_var_without_name',
80
        'php_closing_tag',
81
        'pre_increment',
82
        'php_unit_construct',
83
        'php_unit_strict',
84
        'psr0',
85
        'psr4',
86
        'remove_leading_slash_use',
87
        'remove_lines_between_uses',
88
        'return',
89
        'self_accessor',
90
        'short_array_syntax',
91
        'short_echo_tag',
92
        'short_tag',
93
        'single_array_no_trailing_comma',
94
        'single_blank_line_before_namespace',
95
        'single_line_after_imports',
96
        'single_quote',
97
        'spaces_before_semicolon',
98
        'spaces_cast',
99
        'standardize_not_equal',
100
        'strict',
101
        'strict_param',
102
        'ternary_spaces',
103
        'trailing_spaces',
104
        'trim_array_spaces',
105
        'unalign_double_arrow',
106
        'unalign_equals',
107
        'unary_operators_spaces',
108
        'unused_use',
109
        'visibility',
110
        'whitespacy_lines',
111
    );
112
113
114
    /**
115
     * @var string[]
116
     */
117
    public static $psr1_fixers = array(
0 ignored issues
show
Coding Style introduced by
$psr1_fixers does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
118
        'encoding',
119
        'psr4',
120
        'short_tag',
121
    );
122
123
124
    /**
125
     * @var string[]
126
     */
127
    public static $psr2_fixers = array(
0 ignored issues
show
Coding Style introduced by
$psr2_fixers does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
128
        'braces',
129
        'elseif',
130
        'encoding',
131
        'eof_ending',
132
        'function_call_space',
133
        'function_declaration',
134
        'indentation',
135
        'linefeed',
136
        'line_after_namespace',
137
        'lowercase_constants',
138
        'lowercase_keywords',
139
        'method_argument_space',
140
        'multiple_use',
141
        'parenthesis',
142
        'php_closing_tag',
143
        'psr4',
144
        'short_tag',
145
        'single_line_after_imports',
146
        'trailing_spaces',
147
        'visibility',
148
    );
149
150
151
    /**
152
     * @var string[]
153
     */
154
    public static $symfony_fixers = array(
0 ignored issues
show
Coding Style introduced by
$symfony_fixers does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
155
        'alias_functions',
156
        'blankline_after_open_tag',
157
        'braces',
158
        'concat_without_spaces',
159
        'double_arrow_multiline_whitespaces',
160
        'duplicate_semicolon',
161
        'elseif',
162
        'empty_return',
163
        'encoding',
164
        'eof_ending',
165
        'extra_empty_lines',
166
        'function_call_space',
167
        'function_declaration',
168
        'function_typehint_space',
169
        'include',
170
        'indentation',
171
        'linefeed',
172
        'line_after_namespace',
173
        'list_commas',
174
        'lowercase_constants',
175
        'lowercase_keywords',
176
        'method_argument_space',
177
        'method_separation',
178
        'multiline_array_trailing_comma',
179
        'multiple_use',
180
        'namespace_no_leading_whitespace',
181
        'new_with_braces',
182
        'no_blank_lines_after_class_opening',
183
        'no_empty_lines_after_phpdocs',
184
        'object_operator',
185
        'operators_spaces',
186
        'parenthesis',
187
        'phpdoc_align',
188
        'phpdoc_indent',
189
        'phpdoc_inline_tag',
190
        'phpdoc_no_access',
191
        'phpdoc_no_empty_return',
192
        'phpdoc_no_package',
193
        'phpdoc_scalar',
194
        'phpdoc_separation',
195
        'phpdoc_short_description',
196
        'phpdoc_to_comment',
197
        'phpdoc_trim',
198
        'phpdoc_type_to_var',
199
        'phpdoc_types',
200
        'phpdoc_var_without_name',
201
        'php_closing_tag',
202
        'pre_increment',
203
        'psr4',
204
        'remove_leading_slash_use',
205
        'remove_lines_between_uses',
206
        'return',
207
        'self_accessor',
208
        'short_tag',
209
        'single_array_no_trailing_comma',
210
        'single_blank_line_before_namespace',
211
        'single_line_after_imports',
212
        'single_quote',
213
        'spaces_before_semicolon',
214
        'spaces_cast',
215
        'standardize_not_equal',
216
        'ternary_spaces',
217
        'trailing_spaces',
218
        'trim_array_spaces',
219
        'unalign_double_arrow',
220
        'unalign_equals',
221
        'unary_operators_spaces',
222
        'unused_use',
223
        'visibility',
224
        'whitespacy_lines',
225
    );
226
227
228
    /**
229
     * @var string[]
230
     */
231
    public static $laravel_fixers = array(
0 ignored issues
show
Coding Style introduced by
$laravel_fixers does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
232
        'alias_functions',
233
        'blankline_after_open_tag',
234
        'braces',
235
        'concat_without_spaces',
236
        'double_arrow_multiline_whitespaces',
237
        'duplicate_semicolon',
238
        'elseif',
239
        'empty_return',
240
        'encoding',
241
        'eof_ending',
242
        'extra_empty_lines',
243
        'function_call_space',
244
        'function_declaration',
245
        'function_typehint_space',
246
        'include',
247
        'indentation',
248
        'linefeed',
249
        'line_after_namespace',
250
        'list_commas',
251
        'logical_not_operators_with_successor_space',
252
        'lowercase_constants',
253
        'lowercase_keywords',
254
        'method_argument_space',
255
        'method_separation',
256
        'multiline_array_trailing_comma',
257
        'multiline_spaces_before_semicolon',
258
        'multiple_use',
259
        'namespace_no_leading_whitespace',
260
        'no_blank_lines_after_class_opening',
261
        'no_empty_lines_after_phpdocs',
262
        'object_operator',
263
        'operators_spaces',
264
        'parenthesis',
265
        'phpdoc_indent',
266
        'phpdoc_inline_tag',
267
        'phpdoc_no_access',
268
        'phpdoc_no_package',
269
        'phpdoc_scalar',
270
        'phpdoc_short_description',
271
        'phpdoc_to_comment',
272
        'phpdoc_trim',
273
        'phpdoc_type_to_var',
274
        'phpdoc_types',
275
        'phpdoc_var_without_name',
276
        'psr4',
277
        'remove_leading_slash_use',
278
        'remove_lines_between_uses',
279
        'return',
280
        'self_accessor',
281
        'short_array_syntax',
282
        'short_echo_tag',
283
        'short_tag',
284
        'single_array_no_trailing_comma',
285
        'single_blank_line_before_namespace',
286
        'single_line_after_imports',
287
        'single_quote',
288
        'spaces_before_semicolon',
289
        'spaces_cast',
290
        'standardize_not_equal',
291
        'ternary_spaces',
292
        'trailing_spaces',
293
        'trim_array_spaces',
294
        'unalign_equals',
295
        'unary_operators_spaces',
296
        'unused_use',
297
        'visibility',
298
        'whitespacy_lines',
299
    );
300
301
302
    /**
303
     * @var string[]
304
     */
305
    public static $recommended_fixers = array(
0 ignored issues
show
Coding Style introduced by
$recommended_fixers does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
306
        'alias_functions',
307
        'align_double_arrow',
308
        'blankline_after_open_tag',
309
        'braces',
310
        'concat_without_spaces',
311
        'double_arrow_multiline_whitespaces',
312
        'duplicate_semicolon',
313
        'elseif',
314
        'empty_return',
315
        'encoding',
316
        'eof_ending',
317
        'extra_empty_lines',
318
        'function_call_space',
319
        'function_declaration',
320
        'function_typehint_space',
321
        'include',
322
        'indentation',
323
        'linefeed',
324
        'line_after_namespace',
325
        'list_commas',
326
        'lowercase_constants',
327
        'lowercase_keywords',
328
        'method_argument_space',
329
        'method_separation',
330
        'multiline_array_trailing_comma',
331
        'multiline_spaces_before_semicolon',
332
        'multiple_use',
333
        'namespace_no_leading_whitespace',
334
        'new_with_braces',
335
        'no_blank_lines_after_class_opening',
336
        'no_empty_lines_after_phpdocs',
337
        'object_operator',
338
        'operators_spaces',
339
        'ordered_use',
340
        'parenthesis',
341
        'phpdoc_align',
342
        'phpdoc_indent',
343
        'phpdoc_inline_tag',
344
        'phpdoc_no_access',
345
        'phpdoc_no_package',
346
        'phpdoc_order',
347
        'phpdoc_scalar',
348
        'phpdoc_separation',
349
        'phpdoc_short_description',
350
        'phpdoc_to_comment',
351
        'phpdoc_trim',
352
        'phpdoc_type_to_var',
353
        'phpdoc_types',
354
        'phpdoc_var_without_name',
355
        'php_closing_tag',
356
        'psr4',
357
        'remove_leading_slash_use',
358
        'remove_lines_between_uses',
359
        'return',
360
        'self_accessor',
361
        'short_array_syntax',
362
        'short_tag',
363
        'single_array_no_trailing_comma',
364
        'single_blank_line_before_namespace',
365
        'single_line_after_imports',
366
        'single_quote',
367
        'spaces_before_semicolon',
368
        'spaces_cast',
369
        'standardize_not_equal',
370
        'ternary_spaces',
371
        'trailing_spaces',
372
        'trim_array_spaces',
373
        'unalign_equals',
374
        'unary_operators_spaces',
375
        'unused_use',
376
        'visibility',
377
        'whitespacy_lines',
378
    );
379
380
381
    /**
382
     * @var string[]
383
     */
384
    public static $aliases = array(
385
        'phpdoc_params' => 'phpdoc_align',
386
        'join_function' => 'alias_functions',
387
    );
388
389
390
    /**
391
     * @var string[]
392
     */
393
    public static $conflicts = array(
394
        'concat_with_spaces' => 'concat_without_spaces',
395
        'long_array_syntax' => 'short_array_syntax',
396
        'no_blank_lines_before_namespace' => 'single_blank_line_before_namespace',
397
        'phpdoc_var_to_type' => 'phpdoc_type_to_var',
398
        'psr0' => 'psr4',
399
        'unalign_double_arrow' => 'align_double_arrow',
400
        'unalign_equals' => 'align_equals',
401
    );
402
403
    public static function getPresets()
404
    {
405
        return array(
406
            'psr1' => self::$psr1_fixers,
407
            'psr2' => self::$psr2_fixers,
408
            'symfony' => self::$symfony_fixers,
409
            'laravel' => self::$laravel_fixers,
410
            'recommended' => self::$recommended_fixers,
411
        );
412
    }
413
}
414