|
| 1 | +<?php declare(strict_types=1); |
| 2 | + |
| 3 | +/** |
| 4 | + * PHP-CS-Fixer config for RobThree/TwoFactorAuth |
| 5 | + */ |
| 6 | +$finder = PhpCsFixer\Finder::create() |
| 7 | + ->name('/\.php|\.php.dist$/') |
| 8 | + ->exclude('build') |
| 9 | + ->exclude('demo') |
| 10 | + ->exclude('docs') |
| 11 | + ->in(['lib', 'tests', 'testsDependency']) |
| 12 | +; |
| 13 | + |
| 14 | +$config = new PhpCsFixer\Config(); |
| 15 | + |
| 16 | +return $config->setRules(array( |
| 17 | + '@PSR2' => true, |
| 18 | + '@PSR12' => true, |
| 19 | + '@PHP82Migration' => true, |
| 20 | + 'array_syntax' => ['syntax' => 'long'], |
| 21 | + 'class_attributes_separation' => true, |
| 22 | + 'declare_strict_types' => true, |
| 23 | + 'dir_constant' => true, |
| 24 | + 'is_null' => true, |
| 25 | + 'no_homoglyph_names' => true, |
| 26 | + 'no_null_property_initialization' => true, |
| 27 | + 'no_php4_constructor' => true, |
| 28 | + 'no_unused_imports' => true, |
| 29 | + 'no_useless_else' => true, |
| 30 | + 'non_printable_character' => true, |
| 31 | + 'ordered_imports' => true, |
| 32 | + 'ordered_class_elements' => true, |
| 33 | + 'php_unit_construct' => true, |
| 34 | + 'pow_to_exponentiation' => true, |
| 35 | + 'psr_autoloading' => true, |
| 36 | + 'random_api_migration' => true, |
| 37 | + 'return_assignment' => true, |
| 38 | + 'self_accessor' => true, |
| 39 | + 'semicolon_after_instruction' => true, |
| 40 | + 'short_scalar_cast' => true, |
| 41 | + 'simplified_null_return' => true, |
| 42 | + 'single_blank_line_before_namespace' => true, |
| 43 | + 'single_class_element_per_statement' => true, |
| 44 | + 'single_line_comment_style' => true, |
| 45 | + 'single_quote' => true, |
| 46 | + 'space_after_semicolon' => true, |
| 47 | + 'standardize_not_equals' => true, |
| 48 | + 'strict_param' => true, |
| 49 | + 'ternary_operator_spaces' => true, |
| 50 | + 'trailing_comma_in_multiline' => true, |
| 51 | + 'trim_array_spaces' => true, |
| 52 | + 'unary_operator_spaces' => true, |
| 53 | + 'global_namespace_import' => [ |
| 54 | + 'import_classes' => true, |
| 55 | + 'import_functions' => true, |
| 56 | + 'import_constants' => true, |
| 57 | + ], |
| 58 | +)) |
| 59 | + ->setFinder($finder) |
| 60 | + ->setRiskyAllowed(true) |
| 61 | +; |
0 commit comments