Skip to content

Commit 1cfba2d

Browse files
committed
Add php-cs-fixer, reformat code and update guzzle dependency
1 parent 6f378c8 commit 1cfba2d

18 files changed

+2325
-80
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
2-
vendor
2+
vendor
3+
.php_cs.cache

.php_cs.dist

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setRiskyAllowed(false)
5+
->setRules([
6+
'@PSR2' => true,
7+
'@Symfony' => true,
8+
'@PhpCsFixer' => true,
9+
'array_syntax' => ['syntax' => 'short'],
10+
'cast_spaces' => ['space' => 'none'],
11+
'concat_space' => ['spacing' => 'one'],
12+
'yoda_style' => null,
13+
'ordered_class_elements' => null,
14+
'ordered_imports' => null,
15+
//'method_argument_space' => null,
16+
//'no_whitespace_in_blank_line' => null,
17+
//'no_extra_blank_lines' => null,
18+
//'braces' => null,
19+
'blank_line_before_statement' => null,
20+
'phpdoc_align' => ['align' => 'left'],
21+
'phpdoc_var_without_name' => null,
22+
'phpdoc_types_order' => null,
23+
'phpdoc_order' => null,
24+
'phpdoc_separation' => null,
25+
//'no_superfluous_elseif' => null,
26+
'class_definition' => null,
27+
'ternary_to_null_coalescing' => true,
28+
'php_unit_test_class_requires_covers' => false,
29+
'php_unit_internal_class' => false,
30+
])
31+
->setFinder(
32+
PhpCsFixer\Finder::create()
33+
->in(__DIR__ . '/src')
34+
)
35+
;

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
current_dir = $(shell pwd)
2+
3+
make:
4+
composer install
5+
composer dump-autoload
6+
7+
cs-fix:
8+
./vendor/bin/php-cs-fixer fix ./src --config .php_cs.dist
9+
./vendor/bin/php-cs-fixer fix ./examples --config .php_cs.dist

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"psr-4": {
2828
"easybill\\SDK\\": "src/"
2929
}
30+
},
31+
"require-dev": {
32+
"friendsofphp/php-cs-fixer": "^2.17"
3033
}
3134
}

0 commit comments

Comments
 (0)