|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +/* |
| 6 | + * This file is part of the Neo4j PHP Client and Driver package. |
| 7 | + * |
| 8 | + * (c) Nagels <https://nagels.tech> |
| 9 | + * |
| 10 | + * For the full copyright and license information, please view the LICENSE |
| 11 | + * file that was distributed with this source code. |
| 12 | + */ |
| 13 | + |
| 14 | +use PhpCsFixer\Config; |
| 15 | +use PhpCsFixerCustomFixers\Fixer\ConstructorEmptyBracesFixer; |
| 16 | +use PhpCsFixerCustomFixers\Fixer\IssetToArrayKeyExistsFixer; |
| 17 | +use PhpCsFixerCustomFixers\Fixer\MultilineCommentOpeningClosingAloneFixer; |
| 18 | +use PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer; |
| 19 | +use PhpCsFixerCustomFixers\Fixer\PhpdocNoSuperfluousParamFixer; |
| 20 | +use PhpCsFixerCustomFixers\Fixer\PhpdocParamOrderFixer; |
| 21 | +use PhpCsFixerCustomFixers\Fixer\PhpUnitAssertArgumentsOrderFixer; |
| 22 | +use PhpCsFixerCustomFixers\Fixer\StringableInterfaceFixer; |
| 23 | + |
| 24 | +try { |
| 25 | + $finder = PhpCsFixer\Finder::create() |
| 26 | + ->in(__DIR__.'/src') |
| 27 | + ->in(__DIR__.'/tests'); |
| 28 | +} catch (Throwable $e) { |
| 29 | + echo $e->getMessage()."\n"; |
| 30 | + |
| 31 | + exit(1); |
| 32 | +} |
| 33 | + |
| 34 | +return (new Config()) |
| 35 | + ->setRiskyAllowed(true) |
| 36 | + ->setRules([ |
| 37 | + '@Symfony' => true, |
| 38 | + |
| 39 | + 'array_syntax' => ['syntax' => 'short'], |
| 40 | + 'linebreak_after_opening_tag' => true, |
| 41 | + 'ordered_imports' => true, |
| 42 | + 'phpdoc_order' => true, |
| 43 | + 'phpdoc_to_comment' => false, |
| 44 | + 'yoda_style' => false, |
| 45 | + 'declare_strict_types' => true, |
| 46 | + 'global_namespace_import' => [ |
| 47 | + 'import_classes' => true, |
| 48 | + 'import_constants' => true, |
| 49 | + 'import_functions' => true, |
| 50 | + ], |
| 51 | + ConstructorEmptyBracesFixer::name() => true, |
| 52 | + IssetToArrayKeyExistsFixer::name() => true, |
| 53 | + MultilineCommentOpeningClosingAloneFixer::name() => true, |
| 54 | + MultilinePromotedPropertiesFixer::name() => true, |
| 55 | + PhpUnitAssertArgumentsOrderFixer::name() => true, |
| 56 | + PhpdocNoSuperfluousParamFixer::name() => true, |
| 57 | + PhpdocParamOrderFixer::name() => true, |
| 58 | + StringableInterfaceFixer::name() => true, |
| 59 | + ]) |
| 60 | + ->setFinder($finder) |
| 61 | + ->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers()) |
| 62 | +; |
0 commit comments