Skip to content

Commit

Permalink
Update coding style rules
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed Sep 19, 2023
1 parent dc0e632 commit 634fb44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,20 @@
'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,
'combine_consecutive_unsets' => true,
'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'],
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
8 changes: 8 additions & 0 deletions build-ext
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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";
}

0 comments on commit 634fb44

Please sign in to comment.