Skip to content

Commit 2108da0

Browse files
committed
updated rules
SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly: disabled because it enforces `use` statements in the global code
1 parent 560c193 commit 2108da0

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

preset-fixer/common/Nette.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
return [
66
'@PSR12' => true,
77
'@PSR12:risky' => true,
8-
'new_with_braces' => false, // new stdClass
8+
'new_with_parentheses' => false, // new stdClass
99
'single_line_after_imports' => false, // Nette uses two empty lines
1010
'blank_line_after_namespace' => false,
1111
'ordered_imports' => true, // Use statements are alphabetically ordered
1212
'blank_line_between_import_groups' => false,
1313

14-
// braces split
15-
'braces' => false,
1614
// Ensures a single space after language constructs
17-
'single_space_after_construct' => true,
15+
'single_space_around_construct' => true,
1816
// The body of each control structure MUST be enclosed within braces
1917
'control_structure_braces' => true,
2018
// Control structure continuation keyword must be on the configured line
@@ -108,7 +106,8 @@
108106
// Remove useless semicolon statements
109107
'no_empty_statement' => true,
110108

111-
'no_unneeded_curly_braces' => true,
109+
// Removes unneeded braces that are superfluous and aren’t part of a control structure’s body
110+
'no_unneeded_braces' => true,
112111

113112
// Remove trailing commas in list() calls.
114113
'no_trailing_comma_in_singleline' => true,
@@ -166,7 +165,8 @@
166165
// Convert double quotes to single quotes for simple strings.
167166
'single_quote' => true,
168167

169-
'escape_implicit_backslashes' => true,
168+
// Handles implicit backslashes in strings and heredocs
169+
'string_implicit_backslashes' => true,
170170

171171
// Convert ${..} to {$..}
172172
'simple_to_complex_string_variable' => true,

preset-sniffer/Nette.xml

-14
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,6 @@ https://github.com/slevomat/coding-standard
253253
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/>
254254
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
255255
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
256-
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
257-
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName"/>
258-
<properties>
259-
<property name="allowFallbackGlobalConstants" value="true"/>
260-
<property name="allowFallbackGlobalFunctions" value="true"/>
261-
<property name="allowFullyQualifiedGlobalClasses" value="true"/>
262-
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
263-
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
264-
<property name="allowFullyQualifiedNameForCollidingClasses" value="true"/>
265-
<property name="allowFullyQualifiedNameForCollidingConstants" value="true"/>
266-
<property name="allowFullyQualifiedNameForCollidingFunctions" value="true"/>
267-
<property name="searchAnnotations" value="true"/>
268-
</properties>
269-
</rule>
270256
<rule ref="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment">
271257
<exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment.OneLinePropertyComment"/>
272258
</rule>

0 commit comments

Comments
 (0)