Skip to content

Commit

Permalink
chore: update php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvargiu committed Jun 22, 2022
1 parent b6a3d17 commit 39d9762
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/vendor/
/.phpunit.result.cache
/.php_cs.cache
/.php-cs-fixer.cache
/composer.lock
60 changes: 60 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

/*
* Additional rules or rules to override.
* These rules will be added to default rules or will override them if the same key already exists.
*/

$additionalRules = [
'visibility_required' => true,
'heredoc_indentation' => true,
'heredoc_to_nowdoc' => true,
'no_null_property_initialization' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'constant_case' => true,
'declare_strict_types' => true,
'indentation_type' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'phpdoc_line_span' => [
'const' => 'single',
'method' => 'multi',
'property' => 'single',
],
'phpdoc_trim_consecutive_blank_line_separation' => true,
// risky rules
'fopen_flag_order' => true,
'fopen_flags' => true,
'ereg_to_preg' => true,
'implode_call' => true,
'no_unset_on_property' => true,
// custom
'comment_to_phpdoc' => true,
'phpdoc_to_comment' => false,
];
$rulesProvider = new Facile\CodingStandards\Rules\CompositeRulesProvider([
new Facile\CodingStandards\Rules\DefaultRulesProvider(),
new Facile\CodingStandards\Rules\ArrayRulesProvider($additionalRules),
]);

$config = new PhpCsFixer\Config();
$config->setRules($rulesProvider->getRules());

$finder = new PhpCsFixer\Finder();

/*
* You can set manually these paths:
*/
$autoloadPathProvider = new Facile\CodingStandards\AutoloadPathProvider();
$finder->in($autoloadPathProvider->getPaths());

$config->setFinder($finder);

return $config;
52 changes: 0 additions & 52 deletions .php_cs

This file was deleted.

27 changes: 0 additions & 27 deletions .php_cs.dist

This file was deleted.

9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
],
"minimum-stability": "stable",
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"facile-it/facile-coding-standard": true
}
},
"keywords": [
"jwt",
Expand Down Expand Up @@ -58,8 +61,8 @@
}
},
"require-dev": {
"facile-it/facile-coding-standard": "^0.4.1",
"friendsofphp/php-cs-fixer": "^2.16.1",
"facile-it/facile-coding-standard": "^0.5",
"friendsofphp/php-cs-fixer": "^3.0",
"laminas/laminas-diactoros": "^2.2",
"php-http/curl-client": "^2.1",
"phpspec/prophecy-phpunit": "^1.1 || ^2.0",
Expand Down

0 comments on commit 39d9762

Please sign in to comment.