Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit ebe05fb

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/nlcst-to-string-2.0.4
2 parents 302b92b + 8d902e7 commit ebe05fb

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

src/Config.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,14 @@ public function getPhp71Rules(): array
292292
}
293293

294294
/**
295-
* @return true[]
295+
* @return false[]
296296
*
297-
* @psalm-return array{heredoc_indentation: true}
297+
* @psalm-return array{heredoc_indentation: false}
298298
*/
299299
public function getPhp73Rules(): array
300300
{
301301
return [
302-
'heredoc_indentation' => true,
302+
'heredoc_indentation' => false,
303303
];
304304
}
305305

@@ -518,7 +518,7 @@ public function getPHPUnitRules(): array
518518
/**
519519
* @return ((bool|string|string[])[]|bool)[]
520520
*
521-
* @psalm-return array{set_type_to_cast: true, lowercase_static_reference: true, native_constant_invocation: true, blank_line_before_statement: array{statements: array{0: string, 1: string, 2: string, 3: string, 4: string, 5: string, 6: string, 7: string, 8: string, 9: string, 10: string, 11: string, 12: string, 13: string, 14: string, 15: string, 16: string, 17: string, 18: string, 19: string, 20: string}}, yoda_style: false, cast_spaces: true, class_attributes_separation: array{elements: array{0: string, 1: string}}, error_suppression: array{mute_deprecation_error: true, noise_remaining_usages: false}, standardize_increment: true, concat_space: array{spacing: string}, doctrine_annotation_array_assignment: array{operator: string}, doctrine_annotation_braces: array{syntax: string}, doctrine_annotation_indentation: true, doctrine_annotation_spaces: array{after_argument_assignments: false, after_array_assignments_colon: true, after_array_assignments_equals: false, around_parentheses: true, before_argument_assignments: false, before_array_assignments_colon: false, before_array_assignments_equals: false}, function_to_constant: true, function_typehint_space: true, fopen_flags: true, fopen_flag_order: true, heredoc_to_nowdoc: true, is_null: true, implode_call: true, include: true, increment_style: array{style: string}, no_unneeded_curly_braces: true, no_unneeded_final_method: true, non_printable_character: true, lowercase_cast: true, magic_method_casing: true, method_separation: false, native_function_casing: true, native_function_invocation: true, new_with_braces: true, native_function_type_declaration_casing: true, no_alias_functions: true, no_blank_lines_after_class_opening: true, no_blank_lines_after_phpdoc: true, no_empty_comment: true, no_empty_phpdoc: true, no_empty_statement: true, no_extra_consecutive_blank_lines: false, no_null_property_initialization: true, no_leading_import_slash: true, no_leading_namespace_whitespace: false, no_mixed_echo_print: array{use: string}, no_multiline_whitespace_around_double_arrow: true, no_short_bool_cast: true, no_singleline_whitespace_before_semicolons: true, no_spaces_around_offset: true, no_trailing_comma_in_list_call: true, no_trailing_comma_in_singleline_array: true, no_unneeded_control_parentheses: true, no_unreachable_default_argument_value: true, no_unused_imports: true, no_whitespace_before_comma_in_array: true, no_whitespace_in_blank_line: true, normalize_index_brace: true, object_operator_without_whitespace: true, phpdoc_align: true, phpdoc_annotation_without_dot: true, phpdoc_indent: true, phpdoc_inline_tag: true, phpdoc_no_access: true, phpdoc_no_alias_tag: true, phpdoc_no_empty_return: false, phpdoc_no_package: true, phpdoc_no_useless_inheritdoc: true, phpdoc_return_self_reference: true, phpdoc_scalar: true, phpdoc_separation: true, phpdoc_single_line_var_spacing: true, phpdoc_summary: true, phpdoc_to_comment: false, phpdoc_trim: true, phpdoc_types: true, phpdoc_var_without_name: true, phpdoc_trim_consecutive_blank_line_separation: true, return_type_declaration: true, self_accessor: false, short_scalar_cast: true, silenced_deprecation_error: false, simple_to_complex_string_variable: true, single_blank_line_before_namespace: true, single_quote: true, single_trait_insert_per_statement: true, single_line_comment_style: false, single_line_throw: true, standardize_not_equals: true, ternary_operator_spaces: true, ternary_to_null_coalescing: true, trailing_comma_in_multiline_array: true, trim_array_spaces: true, unary_operator_spaces: true, whitespace_after_comma_in_array: true}
521+
* @psalm-return array{set_type_to_cast: true, lowercase_static_reference: true, native_constant_invocation: true, blank_line_before_statement: array{statements: array{0: string, 1: string, 2: string, 3: string, 4: string, 5: string, 6: string, 7: string, 8: string, 9: string, 10: string, 11: string, 12: string, 13: string, 14: string, 15: string, 16: string, 17: string, 18: string, 19: string, 20: string}}, yoda_style: false, cast_spaces: true, class_attributes_separation: array{elements: array{0: string, 1: string}}, error_suppression: array{mute_deprecation_error: true, noise_remaining_usages: false}, standardize_increment: true, concat_space: array{spacing: string}, doctrine_annotation_array_assignment: array{operator: string}, doctrine_annotation_braces: array{syntax: string}, doctrine_annotation_indentation: true, doctrine_annotation_spaces: array{after_argument_assignments: false, after_array_assignments_colon: true, after_array_assignments_equals: false, around_parentheses: true, before_argument_assignments: false, before_array_assignments_colon: false, before_array_assignments_equals: false}, function_to_constant: true, function_typehint_space: true, fopen_flags: true, fopen_flag_order: true, heredoc_to_nowdoc: true, is_null: true, implode_call: true, include: true, increment_style: array{style: string}, no_unneeded_curly_braces: true, no_unneeded_final_method: true, non_printable_character: true, lowercase_cast: true, magic_method_casing: true, method_separation: false, native_function_casing: true, native_function_invocation: array{include: array{0: string}, scope: string, strict: true}, new_with_braces: true, native_function_type_declaration_casing: true, no_alias_functions: true, no_blank_lines_after_class_opening: true, no_blank_lines_after_phpdoc: true, no_empty_comment: true, no_empty_phpdoc: true, no_empty_statement: true, no_extra_consecutive_blank_lines: false, no_null_property_initialization: true, no_leading_import_slash: true, no_leading_namespace_whitespace: false, no_mixed_echo_print: array{use: string}, no_multiline_whitespace_around_double_arrow: true, no_short_bool_cast: true, no_singleline_whitespace_before_semicolons: true, no_spaces_around_offset: true, no_trailing_comma_in_list_call: true, no_trailing_comma_in_singleline_array: true, no_unneeded_control_parentheses: true, no_unreachable_default_argument_value: true, no_unused_imports: true, no_whitespace_before_comma_in_array: true, no_whitespace_in_blank_line: true, normalize_index_brace: true, object_operator_without_whitespace: true, phpdoc_align: true, phpdoc_annotation_without_dot: true, phpdoc_indent: true, phpdoc_inline_tag: true, phpdoc_no_access: true, phpdoc_no_alias_tag: true, phpdoc_no_empty_return: false, phpdoc_no_package: true, phpdoc_no_useless_inheritdoc: true, phpdoc_return_self_reference: true, phpdoc_scalar: true, phpdoc_separation: true, phpdoc_single_line_var_spacing: true, phpdoc_summary: true, phpdoc_to_comment: false, phpdoc_trim: true, phpdoc_types: true, phpdoc_var_without_name: true, phpdoc_trim_consecutive_blank_line_separation: true, return_type_declaration: true, self_accessor: false, short_scalar_cast: true, silenced_deprecation_error: false, simple_to_complex_string_variable: true, single_blank_line_before_namespace: true, single_quote: true, single_trait_insert_per_statement: true, single_line_comment_style: false, single_line_throw: false, standardize_not_equals: true, ternary_operator_spaces: true, ternary_to_null_coalescing: true, trailing_comma_in_multiline_array: true, trim_array_spaces: true, unary_operator_spaces: true, whitespace_after_comma_in_array: true}
522522
*/
523523
public function getSymfonyRules(): array
524524
{
@@ -601,7 +601,11 @@ public function getSymfonyRules(): array
601601
'magic_method_casing' => true,
602602
'method_separation' => false,
603603
'native_function_casing' => true,
604-
'native_function_invocation' => true,
604+
'native_function_invocation' => [
605+
'include' => ['@compiler_optimized'],
606+
'scope' => 'namespaced',
607+
'strict' => true,
608+
],
605609
'new_with_braces' => true,
606610
'native_function_type_declaration_casing' => true,
607611
'no_alias_functions' => true,
@@ -658,7 +662,7 @@ public function getSymfonyRules(): array
658662
'single_quote' => true,
659663
'single_trait_insert_per_statement' => true,
660664
'single_line_comment_style' => false,
661-
'single_line_throw' => true,
665+
'single_line_throw' => false,
662666
'standardize_not_equals' => true,
663667
'ternary_operator_spaces' => true,
664668
'ternary_to_null_coalescing' => true,

tests/Unit/ConfigTest.php

+15-9
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@ public static function provideDoesNotHaveRulesEnabledCases(): iterable
400400
'simplified_null_return' => 'it changes behaviour on void return',
401401
];
402402

403-
$fixers = array_merge($contribFixers, $symfonyFixers);
403+
$php73Fixers = [
404+
'heredoc_indentation' => 'Is destroying Heredoc/nowdoc',
405+
];
406+
407+
$fixers = array_merge($contribFixers, $symfonyFixers, $php73Fixers);
404408

405409
$data = [];
406410

@@ -440,8 +444,6 @@ public function testHeaderCommentFixerIsEnabledIfHeaderIsProvided(string $header
440444
}
441445

442446
/**
443-
* @return Generator
444-
*
445447
* @psalm-return Generator<string, array{0: string}, mixed, void>
446448
*/
447449
public static function provideHeaderCommentFixerIsEnabledIfHeaderIsProvidedCases(): iterable
@@ -515,13 +517,13 @@ protected function getPhp71Rules(): array
515517
}
516518

517519
/**
518-
* @return array<string, bool>
520+
* @return false[]
519521
*
520-
* @psalm-return array{heredoc_indentation: true}
522+
* @psalm-return array{heredoc_indentation: false}
521523
*/
522524
protected function getPhp73Rules(): array
523525
{
524-
return ['heredoc_indentation' => true];
526+
return ['heredoc_indentation' => false];
525527
}
526528

527529
/**
@@ -739,7 +741,7 @@ protected function getPHPUnitRules(): array
739741
/**
740742
* @return ((bool|string|string[])[]|bool)[]
741743
*
742-
* @psalm-return array{set_type_to_cast: true, lowercase_static_reference: true, native_constant_invocation: true, blank_line_before_statement: array{statements: array{0: string, 1: string, 2: string, 3: string, 4: string, 5: string, 6: string, 7: string, 8: string, 9: string, 10: string, 11: string, 12: string, 13: string, 14: string, 15: string, 16: string, 17: string, 18: string, 19: string, 20: string}}, yoda_style: false, cast_spaces: true, class_attributes_separation: array{elements: array{0: string, 1: string}}, error_suppression: array{mute_deprecation_error: true, noise_remaining_usages: false}, standardize_increment: true, concat_space: array{spacing: string}, doctrine_annotation_array_assignment: array{operator: string}, doctrine_annotation_braces: array{syntax: string}, doctrine_annotation_indentation: true, doctrine_annotation_spaces: array{after_argument_assignments: false, after_array_assignments_colon: true, after_array_assignments_equals: false, around_parentheses: true, before_argument_assignments: false, before_array_assignments_colon: false, before_array_assignments_equals: false}, function_to_constant: true, function_typehint_space: true, fopen_flags: true, fopen_flag_order: true, heredoc_to_nowdoc: true, is_null: true, implode_call: true, include: true, increment_style: array{style: string}, no_unneeded_curly_braces: true, no_unneeded_final_method: true, non_printable_character: true, lowercase_cast: true, magic_method_casing: true, method_separation: false, native_function_casing: true, native_function_invocation: true, new_with_braces: true, native_function_type_declaration_casing: true, no_alias_functions: true, no_blank_lines_after_class_opening: true, no_blank_lines_after_phpdoc: true, no_empty_comment: true, no_empty_phpdoc: true, no_empty_statement: true, no_extra_consecutive_blank_lines: false, no_null_property_initialization: true, no_leading_import_slash: true, no_leading_namespace_whitespace: false, no_mixed_echo_print: array{use: string}, no_multiline_whitespace_around_double_arrow: true, no_short_bool_cast: true, no_singleline_whitespace_before_semicolons: true, no_spaces_around_offset: true, no_trailing_comma_in_list_call: true, no_trailing_comma_in_singleline_array: true, no_unneeded_control_parentheses: true, no_unreachable_default_argument_value: true, no_unused_imports: true, no_whitespace_before_comma_in_array: true, no_whitespace_in_blank_line: true, normalize_index_brace: true, object_operator_without_whitespace: true, phpdoc_align: true, phpdoc_annotation_without_dot: true, phpdoc_indent: true, phpdoc_inline_tag: true, phpdoc_no_access: true, phpdoc_no_alias_tag: true, phpdoc_no_empty_return: false, phpdoc_no_package: true, phpdoc_no_useless_inheritdoc: true, phpdoc_return_self_reference: true, phpdoc_scalar: true, phpdoc_separation: true, phpdoc_single_line_var_spacing: true, phpdoc_summary: true, phpdoc_to_comment: false, phpdoc_trim: true, phpdoc_types: true, phpdoc_var_without_name: true, phpdoc_trim_consecutive_blank_line_separation: true, return_type_declaration: true, self_accessor: false, short_scalar_cast: true, silenced_deprecation_error: false, simple_to_complex_string_variable: true, single_blank_line_before_namespace: true, single_quote: true, single_trait_insert_per_statement: true, single_line_comment_style: false, single_line_throw: true, standardize_not_equals: true, ternary_operator_spaces: true, ternary_to_null_coalescing: true, trailing_comma_in_multiline_array: true, trim_array_spaces: true, unary_operator_spaces: true, whitespace_after_comma_in_array: true}
744+
* @psalm-return array{set_type_to_cast: true, lowercase_static_reference: true, native_constant_invocation: true, blank_line_before_statement: array{statements: array{0: string, 1: string, 2: string, 3: string, 4: string, 5: string, 6: string, 7: string, 8: string, 9: string, 10: string, 11: string, 12: string, 13: string, 14: string, 15: string, 16: string, 17: string, 18: string, 19: string, 20: string}}, yoda_style: false, cast_spaces: true, class_attributes_separation: array{elements: array{0: string, 1: string}}, error_suppression: array{mute_deprecation_error: true, noise_remaining_usages: false}, standardize_increment: true, concat_space: array{spacing: string}, doctrine_annotation_array_assignment: array{operator: string}, doctrine_annotation_braces: array{syntax: string}, doctrine_annotation_indentation: true, doctrine_annotation_spaces: array{after_argument_assignments: false, after_array_assignments_colon: true, after_array_assignments_equals: false, around_parentheses: true, before_argument_assignments: false, before_array_assignments_colon: false, before_array_assignments_equals: false}, function_to_constant: true, function_typehint_space: true, fopen_flags: true, fopen_flag_order: true, heredoc_to_nowdoc: true, is_null: true, implode_call: true, include: true, increment_style: array{style: string}, no_unneeded_curly_braces: true, no_unneeded_final_method: true, non_printable_character: true, lowercase_cast: true, magic_method_casing: true, method_separation: false, native_function_casing: true, native_function_invocation: array{include: array{0: string}, scope: string, strict: true}, new_with_braces: true, native_function_type_declaration_casing: true, no_alias_functions: true, no_blank_lines_after_class_opening: true, no_blank_lines_after_phpdoc: true, no_empty_comment: true, no_empty_phpdoc: true, no_empty_statement: true, no_extra_consecutive_blank_lines: false, no_null_property_initialization: true, no_leading_import_slash: true, no_leading_namespace_whitespace: false, no_mixed_echo_print: array{use: string}, no_multiline_whitespace_around_double_arrow: true, no_short_bool_cast: true, no_singleline_whitespace_before_semicolons: true, no_spaces_around_offset: true, no_trailing_comma_in_list_call: true, no_trailing_comma_in_singleline_array: true, no_unneeded_control_parentheses: true, no_unreachable_default_argument_value: true, no_unused_imports: true, no_whitespace_before_comma_in_array: true, no_whitespace_in_blank_line: true, normalize_index_brace: true, object_operator_without_whitespace: true, phpdoc_align: true, phpdoc_annotation_without_dot: true, phpdoc_indent: true, phpdoc_inline_tag: true, phpdoc_no_access: true, phpdoc_no_alias_tag: true, phpdoc_no_empty_return: false, phpdoc_no_package: true, phpdoc_no_useless_inheritdoc: true, phpdoc_return_self_reference: true, phpdoc_scalar: true, phpdoc_separation: true, phpdoc_single_line_var_spacing: true, phpdoc_summary: true, phpdoc_to_comment: false, phpdoc_trim: true, phpdoc_types: true, phpdoc_var_without_name: true, phpdoc_trim_consecutive_blank_line_separation: true, return_type_declaration: true, self_accessor: false, short_scalar_cast: true, silenced_deprecation_error: false, simple_to_complex_string_variable: true, single_blank_line_before_namespace: true, single_quote: true, single_trait_insert_per_statement: true, single_line_comment_style: false, single_line_throw: false, standardize_not_equals: true, ternary_operator_spaces: true, ternary_to_null_coalescing: true, trailing_comma_in_multiline_array: true, trim_array_spaces: true, unary_operator_spaces: true, whitespace_after_comma_in_array: true}
743745
*/
744746
protected function getSymfonyRules(): array
745747
{
@@ -822,7 +824,11 @@ protected function getSymfonyRules(): array
822824
'magic_method_casing' => true,
823825
'method_separation' => false,
824826
'native_function_casing' => true,
825-
'native_function_invocation' => true,
827+
'native_function_invocation' => [
828+
'include' => ['@compiler_optimized'],
829+
'scope' => 'namespaced',
830+
'strict' => true,
831+
],
826832
'new_with_braces' => true,
827833
'native_function_type_declaration_casing' => true,
828834
'no_alias_functions' => true,
@@ -879,7 +885,7 @@ protected function getSymfonyRules(): array
879885
'single_quote' => true,
880886
'single_trait_insert_per_statement' => true,
881887
'single_line_comment_style' => false,
882-
'single_line_throw' => true,
888+
'single_line_throw' => false,
883889
'standardize_not_equals' => true,
884890
'ternary_operator_spaces' => true,
885891
'ternary_to_null_coalescing' => true,

0 commit comments

Comments
 (0)