diff --git a/.gitattributes b/.gitattributes index bb6265e..757ed64 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,8 +4,6 @@ # Ignore all test and documentation with "export-ignore". /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore /tests export-ignore /.editorconfig export-ignore diff --git a/.gitignore b/.gitignore index 8333128..e797ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ +.idea +.php_cs +.php_cs.cache .phpunit.result.cache build composer.lock -docs +coverage +phpunit.xml +psalm.xml vendor diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..ac127a7 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,40 @@ +in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->name('*.php') + ->notName('*.blade.php') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'trailing_comma_in_multiline_array' => true, + 'phpdoc_scalar' => true, + 'unary_operator_spaces' => true, + 'binary_operator_spaces' => true, + 'blank_line_before_statement' => [ + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], + ], + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_var_without_name' => true, + 'class_attributes_separation' => [ + 'elements' => [ + 'method', + ], + ], + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ], + 'single_trait_insert_per_statement' => true, + ]) + ->setFinder($finder);