|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +$header = <<<'EOF' |
| 6 | +Copyright 2018 Glu Mobile Inc. |
| 7 | +
|
| 8 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | +you may not use this file except in compliance with the License. |
| 10 | +You may obtain a copy of the License at |
| 11 | +
|
| 12 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +
|
| 14 | +Unless required by applicable law or agreed to in writing, software |
| 15 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | +See the License for the specific language governing permissions and |
| 18 | +limitations under the License. |
| 19 | +EOF; |
| 20 | + |
| 21 | +return (new PhpCsFixer\Config()) |
| 22 | + ->setRiskyAllowed(true) |
| 23 | + ->setRules([ |
| 24 | + '@DoctrineAnnotation' => true, |
| 25 | + '@PhpCsFixer' => true, |
| 26 | + '@PSR2' => true, |
| 27 | + '@Symfony' => true, |
| 28 | + 'align_multiline_comment' => ['comment_type' => 'all_multiline'], |
| 29 | + 'array_syntax' => ['syntax' => 'short'], |
| 30 | + 'binary_operator_spaces' => ['operators' => ['=' => 'align', '=>' => 'align', ]], |
| 31 | + 'blank_line_after_namespace' => true, |
| 32 | + 'blank_line_before_statement' => ['statements' => ['declare']], |
| 33 | + 'class_attributes_separation' => true, |
| 34 | + 'concat_space' => ['spacing' => 'one'], |
| 35 | + 'constant_case' => ['case' => 'lower'], |
| 36 | + 'combine_consecutive_unsets' => true, |
| 37 | + 'declare_strict_types' => true, |
| 38 | + 'general_phpdoc_annotation_remove' => ['annotations' => ['author']], |
| 39 | + 'header_comment' => ['comment_type' => 'PHPDoc', 'header' => $header, 'location' => 'after_open', 'separate' => 'bottom'], |
| 40 | + 'increment_style' => ['style' => 'post'], |
| 41 | + 'lambda_not_used_import' => false, |
| 42 | + 'linebreak_after_opening_tag' => true, |
| 43 | + 'list_syntax' => ['syntax' => 'short'], |
| 44 | + 'lowercase_static_reference' => true, |
| 45 | + 'multiline_comment_opening_closing' => true, |
| 46 | + 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], |
| 47 | + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'allow_unused_params' => true, 'remove_inheritdoc' => false], |
| 48 | + 'no_unused_imports' => true, |
| 49 | + 'no_useless_else' => true, |
| 50 | + 'no_useless_return' => true, |
| 51 | + 'not_operator_with_space' => false, |
| 52 | + 'not_operator_with_successor_space' => false, |
| 53 | + 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true], |
| 54 | + 'php_unit_strict' => false, |
| 55 | + 'phpdoc_align' => ['align' => 'left'], |
| 56 | + 'phpdoc_annotation_without_dot' => false, |
| 57 | + 'phpdoc_no_empty_return' => false, |
| 58 | + 'phpdoc_types_order' => ['sort_algorithm' => 'none', 'null_adjustment' => 'always_last'], |
| 59 | + 'phpdoc_separation' => false, |
| 60 | + 'phpdoc_summary' => false, |
| 61 | + 'ordered_class_elements' => true, |
| 62 | + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], |
| 63 | + 'ordered_types' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 64 | + 'single_line_comment_style' => ['comment_types' => []], |
| 65 | + 'single_line_comment_spacing' => false, |
| 66 | + 'single_line_empty_body' => false, |
| 67 | + 'single_quote' => true, |
| 68 | + 'standardize_increment' => false, |
| 69 | + 'standardize_not_equals' => true, |
| 70 | + 'yoda_style' => ['always_move_variable' => false, 'equal' => false, 'identical' => false], |
| 71 | + ]) |
| 72 | + ->setFinder( |
| 73 | + PhpCsFixer\Finder::create() |
| 74 | + ->exclude(['vendor']) |
| 75 | + ->in(__DIR__) |
| 76 | + ) |
| 77 | + ->setUsingCache(false); |
0 commit comments