Skip to content

Commit

Permalink
Added more php-cs-fixer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
freost committed Nov 13, 2024
1 parent 7fa77d9 commit aee6def
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => ['on_multiline' => 'ignore'],
'multiline_whitespace_before_semicolons' => true,
'native_function_casing' => true,
'native_type_declaration_casing' => true,
'new_with_parentheses' => ['anonymous_class' => false, 'named_class' => false],
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
'no_blank_lines_after_phpdoc' => true,
Expand All @@ -57,12 +59,14 @@
'no_mixed_echo_print' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_space_around_double_colon' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace_in_comment' => true,
'no_trailing_whitespace' => true,
'no_unneeded_control_parentheses' => true,
'no_unset_cast' => true,
'no_unused_imports' => true,
'no_useless_concat_operator' => true,
'no_useless_sprintf' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
Expand Down Expand Up @@ -93,6 +97,7 @@
'pow_to_exponentiation' => true,
'return_type_declaration' => true,
'self_static_accessor' => true,
'semicolon_after_instruction' => true,
'short_scalar_cast' => true,
'simple_to_complex_string_variable' => true,
'single_blank_line_at_eof' => true,
Expand All @@ -105,9 +110,11 @@
'single_trait_insert_per_statement' => true,
'space_after_semicolon' => true,
'spaces_inside_parentheses' => ['space' => 'none'],
'standardize_increment' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match']],
'trim_array_spaces' => true,
'type_declaration_spaces' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function buildJsonPath(array $segments): string
$path .= "[{$segment}]";
}
else {
$path .= '.' . '"' . str_replace(['"', "'"], ['\\\"', "''"], $segment) . '"';
$path .= '."' . str_replace(['"', "'"], ['\\\"', "''"], $segment) . '"';
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/mako/utility/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public static function alternator(array $strings): Alternator
*/
public static function autolink(string $string, array $attributes = []): string
{
return preg_replace_callback('#\b(?<!href="|">)[a-z]+://\S+(?:/|\b)#i', static fn ($matches) => (new HTML())->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]), $string);
return preg_replace_callback('#\b(?<!href="|">)[a-z]+://\S+(?:/|\b)#i', static fn ($matches) => (new HTML)->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]), $string);
}

/**
Expand Down

0 comments on commit aee6def

Please sign in to comment.