Skip to content

Commit 1ce8bfe

Browse files
Disallow useless string concatenation (#35)
1 parent 43b50e0 commit 1ce8bfe

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

Eventjet/ruleset.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@
8383
<!-- Forbid `$this` inside static function -->
8484
<rule ref="Squiz.Scope.StaticThisUsage"/>
8585

86-
<!-- Force whitespace before and after concatenation -->
86+
<!-- String concatenation -->
8787
<rule ref="Squiz.Strings.ConcatenationSpacing">
8888
<properties>
8989
<property name="spacing" value="1"/>
9090
<property name="ignoreNewlines" value="true"/>
9191
</properties>
9292
</rule>
93+
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
9394

9495
<!-- Forbid spaces in type casts -->
9596
<rule ref="Squiz.WhiteSpace.CastSpacing"/>

php-cs-fixer-rules.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
'no_trailing_comma_in_singleline' => true,
6565
'no_unused_imports' => true,
6666
'no_useless_else' => true,
67+
'no_useless_concat_operator' => true,
6768
'nullable_type_declaration_for_default_null_value' => true,
6869
'ordered_imports' => [
6970
'imports_order' => ['class', 'function', 'const'],
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
echo 'a' . 'b';

0 commit comments

Comments
 (0)