Skip to content

Commit 16013a9

Browse files
committed
Adding PHP-CS-Fixer
1 parent b8a7924 commit 16013a9

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package.xml
88
docs
99
.phpintel/
1010
tests/.phpunit.result.cache
11+
.php-cs-fixer.cache
1112

1213
# You should be keeping these in a global gitignore, see for example
1314
# https://help.github.com/articles/ignoring-files#global-gitignore

.php-cs-fixer.dist.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
$config = new PhpCsFixer\Config();
4+
5+
$config->setRules(['nullable_type_declaration_for_default_null_value' => true,]);
6+
7+
return $config->setFinder(PhpCsFixer\Finder::create()->in(__DIR__.'/src'));
8+

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
},
1717
"require-dev": {
1818
"guzzlehttp/guzzle": "^6.3 || ^7.0",
19-
"phpunit/phpunit": ">=7.0 < 10"
19+
"phpunit/phpunit": ">=7.0 < 10",
20+
"friendsofphp/php-cs-fixer": "^3.68"
2021
},
2122
"suggest": {
2223
"guzzlehttp/guzzle": "An HTTP client to execute the API requests"
@@ -32,7 +33,13 @@
3233
"Twilio\\Tests\\": "tests/Twilio/"
3334
}
3435
},
36+
"scripts": {
37+
"php84-fix": [
38+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
39+
"vendor/bin/php-cs-fixer -vvv fix --using-cache=no ."
40+
]
41+
},
3542
"config": {
3643
"lock": false
3744
}
38-
}
45+
}

0 commit comments

Comments
 (0)