Skip to content

Commit

Permalink
Add php-cs-fixer, reformat code and update guzzle dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
PATROMO committed Dec 17, 2020
1 parent 6f378c8 commit 1cfba2d
Show file tree
Hide file tree
Showing 18 changed files with 2,325 additions and 80 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
vendor
vendor
.php_cs.cache
35 changes: 35 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

return PhpCsFixer\Config::create()
->setRiskyAllowed(false)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'yoda_style' => null,
'ordered_class_elements' => null,
'ordered_imports' => null,
//'method_argument_space' => null,
//'no_whitespace_in_blank_line' => null,
//'no_extra_blank_lines' => null,
//'braces' => null,
'blank_line_before_statement' => null,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_var_without_name' => null,
'phpdoc_types_order' => null,
'phpdoc_order' => null,
'phpdoc_separation' => null,
//'no_superfluous_elseif' => null,
'class_definition' => null,
'ternary_to_null_coalescing' => true,
'php_unit_test_class_requires_covers' => false,
'php_unit_internal_class' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
)
;
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
current_dir = $(shell pwd)

make:
composer install
composer dump-autoload

cs-fix:
./vendor/bin/php-cs-fixer fix ./src --config .php_cs.dist
./vendor/bin/php-cs-fixer fix ./examples --config .php_cs.dist
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
"psr-4": {
"easybill\\SDK\\": "src/"
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.17"
}
}
Loading

0 comments on commit 1cfba2d

Please sign in to comment.