2019-09-02 17:08:36 +02:00
|
|
|
<?php
|
|
|
|
|
2022-12-08 20:16:40 +01:00
|
|
|
$config = new class extends Amp\CodeStyle\Config {
|
|
|
|
public function getRules(): array
|
|
|
|
{
|
|
|
|
return array_merge(parent::getRules(), [
|
|
|
|
'void_return' => true,
|
2023-01-26 19:57:50 +01:00
|
|
|
'array_indentation' => true,
|
|
|
|
'ternary_to_null_coalescing' => true,
|
2023-07-04 19:48:23 +02:00
|
|
|
'assign_null_coalescing_to_coalesce_equal' => true,
|
2023-10-01 20:05:04 +02:00
|
|
|
"native_function_invocation" => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
|
2022-12-08 20:16:40 +01:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-09-02 17:08:36 +02:00
|
|
|
$config->getFinder()
|
|
|
|
->in(__DIR__ . '/src')
|
|
|
|
->in(__DIR__ . '/tests')
|
2019-10-29 22:00:21 +01:00
|
|
|
->in(__DIR__ . '/examples')
|
2020-09-24 11:45:20 +02:00
|
|
|
->in(__DIR__ . '/tools');
|
2019-09-02 17:08:36 +02:00
|
|
|
|
|
|
|
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
|
|
|
|
|
|
|
|
$config->setCacheFile($cacheDir . '/.php_cs.cache');
|
|
|
|
|
|
|
|
return $config;
|