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-11-11 16:55:29 +01:00
|
|
|
'@PHP82Migration' => true,
|
|
|
|
'@PHP81Migration' => true,
|
|
|
|
'@PHP80Migration' => true,
|
|
|
|
'@PHP80Migration:risky' => true,
|
|
|
|
'static_lambda' => true,
|
|
|
|
'strict_param' => 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')
|
2024-02-13 21:46:07 +01:00
|
|
|
->in(__DIR__ . '/tools')
|
2024-03-10 15:48:55 +01:00
|
|
|
->notName('TLParser.php')
|
|
|
|
->notName('SecretTLParser.php');
|
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;
|