diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 25f8b67b0..0c0d57964 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/src/mako/database/query/compilers/traits/JsonPathBuilderTrait.php b/src/mako/database/query/compilers/traits/JsonPathBuilderTrait.php index 9e4d9a7a2..d8c657bb7 100644 --- a/src/mako/database/query/compilers/traits/JsonPathBuilderTrait.php +++ b/src/mako/database/query/compilers/traits/JsonPathBuilderTrait.php @@ -27,7 +27,7 @@ protected function buildJsonPath(array $segments): string $path .= "[{$segment}]"; } else { - $path .= '.' . '"' . str_replace(['"', "'"], ['\\\"', "''"], $segment) . '"'; + $path .= '."' . str_replace(['"', "'"], ['\\\"', "''"], $segment) . '"'; } } diff --git a/src/mako/utility/Str.php b/src/mako/utility/Str.php index f342d496c..6a12efb2a 100644 --- a/src/mako/utility/Str.php +++ b/src/mako/utility/Str.php @@ -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(?)[a-z]+://\S+(?:/|\b)#i', static fn ($matches) => (new HTML())->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]), $string); + return preg_replace_callback('#\b(?)[a-z]+://\S+(?:/|\b)#i', static fn ($matches) => (new HTML)->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]), $string); } /**