diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index a143172..ff05a34 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -18,17 +18,13 @@ 'binary_operator_spaces' => true, 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, + 'blank_lines_before_namespace' => true, 'blank_line_before_statement' => [ 'statements' => [ 'break', 'case', 'continue', 'declare', 'default', 'do', 'for', 'if', 'foreach', 'return', 'switch', 'try', 'while', ], ], - 'braces' => [ - 'allow_single_line_closure' => false, - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'next', - ], 'cast_spaces' => ['space' => 'single'], 'class_attributes_separation' => true, 'combine_consecutive_issets' => true, @@ -36,7 +32,6 @@ 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], 'fully_qualified_strict_types' => true, - 'function_typehint_space' => true, 'increment_style' => ['style' => 'pre'], 'linebreak_after_opening_tag' => true, 'list_syntax' => ['syntax' => 'short'], @@ -65,8 +60,7 @@ 'no_spaces_around_offset' => true, 'no_superfluous_phpdoc_tags' => false, 'no_superfluous_elseif' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_comma_in_singleline' => true, 'no_unneeded_control_parentheses' => true, 'no_unneeded_curly_braces' => true, 'no_unset_cast' => true, @@ -114,12 +108,12 @@ 'semicolon_after_instruction' => true, 'short_scalar_cast' => true, 'simplified_null_return' => true, - 'single_blank_line_before_namespace' => true, 'single_quote' => true, 'single_line_comment_style' => true, 'ternary_operator_spaces' => true, 'ternary_to_null_coalescing' => true, 'trim_array_spaces' => true, + 'type_declaration_spaces' => true, 'unary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, ])->setFinder($finder); diff --git a/build-ext b/build-ext index 8a6e42c..d722787 100755 --- a/build-ext +++ b/build-ext @@ -22,15 +22,19 @@ EOT chdir(__DIR__); echo 'Reading config.m4 file... '; + $configM4Contents = file_get_contents(CONFIG_M4_PATH); + if (!$configM4Contents) { fwrite(STDERR, "Failed to read the config.m4 file!\n"); exit(1); } + echo "done.\n"; echo 'Applying libexec patch... '; + if (strpos($configM4Contents, EXECINFO_MATCH) === false) { fwrite(STDERR, "patch entrypoint not found!\n"); @@ -39,12 +43,16 @@ if (strpos($configM4Contents, EXECINFO_MATCH) === false) { echo "already applied.\n"; } else { $configM4Contents = str_replace(EXECINFO_MATCH, EXECINFO_MATCH . EXECINFO_PATCH, $configM4Contents); + echo "done.\n"; + echo 'Saving config.m4 file... '; + if (!file_put_contents(CONFIG_M4_PATH, $configM4Contents)) { fwrite(STDERR, "Failed to write the config.m4 file\n"); exit(1); } + echo "done.\n"; }