diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..1c4e7d5 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,37 @@ +notPath('bootstrap/*') + ->notPath('storage/*') + ->notPath('resources/view/mail/*') + ->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, + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ] + ]) + ->setFinder($finder); diff --git a/README.md b/README.md index e41baad..64f3ce7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-searchable.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-searchable) ![Test Status](https://img.shields.io/github/workflow/status/spatie/laravel-searchable/run-tests?label=tests&style=flat-square) -![Code Style Status](https://img.shields.io/github/workflow/status/spatie/laravel-searchable/php-cs-fixer?label=code%20style&style=flat-square) +![Code Style Status](https://img.shields.io/github/workflow/status/spatie/laravel-searchable/Check%20&%20fix%20styling?label=code%20style&style=flat-square) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-searchable.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-searchable) This package makes it easy to get structured search from a variety of sources. Here's an example where we search through some models. We already did some small preparation on the models themselves.