diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 51bfcbf..fff168a 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -11,31 +11,5 @@ ->ignoreVCS(true); return (new PhpCsFixer\Config()) - ->setRules([ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline' => 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' => 'one', - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - 'php_unit_method_casing' => ['case' => 'camel_case'], - ]) + ->setRules(Descom\Common\CsFixer::rules()) ->setFinder($finder); diff --git a/README.md b/README.md index c3262f8..8b45c63 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Via Composer ```bash -composer require descom/package_name +composer require descom/common ``` ## Usage diff --git a/composer.json b/composer.json index b5d1518..c359ac6 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,11 @@ { - "name": "descom/skeleton", - "description": "package_description", + "name": "descom/common", + "description": "Package to PHP projects in Descom.es", "type": "library", "require": { "php": "^8.0" }, - "homepage": "https://github.com/descom/skeleton", + "homepage": "https://github.com/descom-es/php-common", "license": "MIT", "authors": [ { @@ -22,18 +22,16 @@ "minimum-stability": "dev", "prefer-stable": true, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "phpunit/phpunit": "^9.5", - "phpstan/phpstan": "^1.9" + "friendsofphp/php-cs-fixer": "^3.35", + "phpunit/phpunit": "^9.5" }, "autoload": { "psr-4": { - "Descom\\Skeleton\\": "src" + "Descom\\Common\\": "src" } }, "scripts": { "test": "vendor/bin/phpunit --colors=always", - "style": "vendor/bin/php-cs-fixer fix", - "analyse": "vendor/bin/phpstan analyse" + "style": "vendor/bin/php-cs-fixer fix" } } diff --git a/src/CsFixer.php b/src/CsFixer.php new file mode 100644 index 0000000..e1c2d6a --- /dev/null +++ b/src/CsFixer.php @@ -0,0 +1,37 @@ + true, + 'array_syntax' => ['syntax' => 'short'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'trailing_comma_in_multiline' => 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' => 'one', + ], + ], + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ], + 'single_trait_insert_per_statement' => true, + 'php_unit_method_casing' => ['case' => 'camel_case'], + ]; + } +} diff --git a/src/Skeleton.php b/src/Skeleton.php deleted file mode 100644 index 7fb9953..0000000 --- a/src/Skeleton.php +++ /dev/null @@ -1,8 +0,0 @@ -