diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index b2c8ef60a..bf8aa6922 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -35,6 +35,7 @@ 'function_to_constant' => true, 'get_class_to_class_keyword' => true, 'heredoc_to_nowdoc' => true, + 'include' => true, 'integer_literal_case' => true, 'lambda_not_used_import' => true, 'linebreak_after_opening_tag' => true, @@ -46,6 +47,7 @@ 'magic_constant_casing' => true, 'magic_method_casing' => true, 'method_argument_space' => ['on_multiline' => 'ignore'], + 'modifier_keywords' => true, 'multiline_whitespace_before_semicolons' => true, 'native_function_casing' => true, 'native_type_declaration_casing' => true, @@ -60,6 +62,8 @@ 'no_leading_namespace_whitespace' => true, 'no_mixed_echo_print' => true, 'no_multiline_whitespace_around_double_arrow' => true, + 'no_multiple_statements_per_line' => true, + 'no_redundant_readonly_property' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_space_around_double_colon' => true, 'no_trailing_comma_in_singleline' => true, @@ -69,6 +73,8 @@ 'no_unset_cast' => true, 'no_unused_imports' => true, 'no_useless_concat_operator' => true, + 'no_useless_printf' => true, + 'no_useless_return' => true, 'no_useless_sprintf' => true, 'no_whitespace_before_comma_in_array' => true, 'no_whitespace_in_blank_line' => true, @@ -102,6 +108,7 @@ 'semicolon_after_instruction' => true, 'short_scalar_cast' => true, 'simple_to_complex_string_variable' => true, + 'simplified_null_return' => true, 'single_blank_line_at_eof' => true, 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, @@ -114,6 +121,7 @@ 'spaces_inside_parentheses' => ['space' => 'none'], 'standardize_increment' => true, 'standardize_not_equals' => true, + 'stringable_for_to_string' => true, 'switch_case_semicolon_to_colon' => true, 'switch_case_space' => true, 'ternary_to_null_coalescing' => true, @@ -121,7 +129,6 @@ 'trim_array_spaces' => true, 'type_declaration_spaces' => true, 'types_spaces' => true, - 'visibility_required' => true, 'void_return' => true, 'whitespace_after_comma_in_array' => true, ]) diff --git a/src/mako/view/renderers/PHP.php b/src/mako/view/renderers/PHP.php index 23fdfebd3..b71a2e60a 100644 --- a/src/mako/view/renderers/PHP.php +++ b/src/mako/view/renderers/PHP.php @@ -31,7 +31,7 @@ public function render(string $__view__, array $__variables__): string ob_start(); - include ($__view__); + include $__view__; return ob_get_clean(); } diff --git a/tests/unit/classes/ClassInspectorTest.php b/tests/unit/classes/ClassInspectorTest.php index 6ce35e003..c85958e90 100644 --- a/tests/unit/classes/ClassInspectorTest.php +++ b/tests/unit/classes/ClassInspectorTest.php @@ -47,7 +47,8 @@ trait C class D implements IC, ID { - use B; use C; + use B; + use C; } class E extends D { diff --git a/tests/unit/reactor/traits/FireTraitTest.php b/tests/unit/reactor/traits/FireTraitTest.php index 4f0dbf508..6ff6e882a 100644 --- a/tests/unit/reactor/traits/FireTraitTest.php +++ b/tests/unit/reactor/traits/FireTraitTest.php @@ -27,7 +27,7 @@ public function testBuildReactorPath(): void public function __construct() { $this->app = new class { - public function getPath() + public function getPath(): string { return DIRECTORY_SEPARATOR . 'foo' . DIRECTORY_SEPARATOR . 'bar'; } @@ -56,12 +56,12 @@ public function testBuildCommandWithoutEnv(): void public function __construct() { $this->app = new class { - public function getPath() + public function getPath(): string { return '/foo/bar'; } - public function getEnvironment() + public function getEnvironment(): ?string { return null; } @@ -97,12 +97,12 @@ public function testBuildBackgroundCommandWithoutEnv(): void public function __construct() { $this->app = new class { - public function getPath() + public function getPath(): string { return '/foo/bar'; } - public function getEnvironment() + public function getEnvironment(): ?string { return null; } @@ -138,12 +138,12 @@ public function testBuildCommandWithEnv(): void public function __construct() { $this->app = new class { - public function getPath() + public function getPath(): string { return '/foo/bar'; } - public function getEnvironment() + public function getEnvironment(): ?string { return 'dev'; } @@ -179,12 +179,12 @@ public function testBuildCommandWithEnvWithManualOverride(): void public function __construct() { $this->app = new class { - public function getPath() + public function getPath(): string { return '/foo/bar'; } - public function getEnvironment() + public function getEnvironment(): ?string { return 'dev'; } @@ -220,12 +220,12 @@ public function testBuildCommandWithEnvWithoutUsingSame(): void public function __construct() { $this->app = new class { - public function getPath() + public function getPath(): string { return '/foo/bar'; } - public function getEnvironment() + public function getEnvironment(): ?string { return 'dev'; }