Skip to content

Commit

Permalink
Update PHP-CS-Fixer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 17, 2024
1 parent 67259b3 commit c3d954c
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
'explicit_string_variable' => true,
'fopen_flag_order' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true,
'fully_qualified_strict_types' => ['import_symbols' => true],
'function_declaration' => true,
'function_to_constant' => true,
'get_class_to_class_keyword' => true,
Expand Down Expand Up @@ -135,7 +135,7 @@
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_constant_invocation' => false,
'native_constant_invocation' => true,
'native_function_casing' => false,
'native_function_invocation' => [
'include' => [
Expand All @@ -158,7 +158,23 @@
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_extra_blank_lines' => [
'tokens' => [
'attribute',
'break',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
],
'no_homoglyph_names' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
Expand Down Expand Up @@ -197,6 +213,7 @@
'no_whitespace_in_blank_line' => true,
'non_printable_character' => true,
'normalize_index_brace' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'octal_notation' => true,
'operator_linebreak' => [
Expand Down Expand Up @@ -340,6 +357,8 @@
'whitespace_after_comma_in_array' => true,
]);

$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . sha1(@trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD'))));
$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . json_decode((string) @file_get_contents('composer.json'), true)["extra"]["branch-alias"]["dev-main"] ?? 'unknown');

$config->setParallelConfig(\PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());

return $config;

0 comments on commit c3d954c

Please sign in to comment.