data
4 years ago
lib
4 years ago
.coveralls.github-actions.yml
4 years ago
.php_cs.dist
4 years ago
LICENSE
6 years ago
Makefile
4 years ago
VERSION
4 years ago
build.php
4 years ago
init.php
4 years ago
phpdoc.dist.xml
4 years ago
phpstan-baseline.neon
4 years ago
phpstan.neon.dist
4 years ago
update_certs.php
4 years ago
.php_cs.dist
46 lines
| 1 | <?php |
| 2 | |
| 3 | return PhpCsFixer\Config::create() |
| 4 | ->setRiskyAllowed(true) |
| 5 | ->setRules([ |
| 6 | // Rulesets |
| 7 | '@PSR2' => true, |
| 8 | '@PhpCsFixer' => true, |
| 9 | '@PhpCsFixer:risky' => true, |
| 10 | '@PHP56Migration:risky' => true, |
| 11 | '@PHPUnit57Migration:risky' => true, |
| 12 | |
| 13 | // Additional rules |
| 14 | 'fopen_flags' => true, |
| 15 | 'linebreak_after_opening_tag' => true, |
| 16 | 'native_constant_invocation' => true, |
| 17 | 'native_function_invocation' => true, |
| 18 | |
| 19 | // --- Diffs from @PhpCsFixer / @PhpCsFixer:risky --- |
| 20 | |
| 21 | // This is the same as the default for the @PhpCsFixer ruleset, minus |
| 22 | // the following values: ['include', 'include_once', 'require', |
| 23 | // 'require_once']. We could enable them and remove this line after |
| 24 | // updating codegen for the `init.php` file to be compliant. |
| 25 | 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'return', 'switch', 'throw', 'try']], |
| 26 | |
| 27 | // This is just prettier / easier to read. |
| 28 | 'concat_space' => ['spacing' => 'one'], |
| 29 | |
| 30 | // This causes strange ordering with codegen'd classes. We might be |
| 31 | // able to enable this if we update codegen to output class elements |
| 32 | // in the correct order. |
| 33 | 'ordered_class_elements' => false, |
| 34 | |
| 35 | // Keep this disabled to avoid unnecessary diffs in PHPDoc comments of |
| 36 | // codegen'd classes. |
| 37 | 'phpdoc_align' => false, |
| 38 | |
| 39 | // This is a "risky" rule that causes a bug in our codebase. |
| 40 | // Specifically, in `StripeObject.updateAttributes` we construct new |
| 41 | // `StripeObject`s for metadata. We can't use `self` there because it |
| 42 | // needs to be a raw `StripeObject`. |
| 43 | 'self_accessor' => false, |
| 44 | ]) |
| 45 | ; |
| 46 |