Skip to content

Commit 209bde5

Browse files
authored
Merge pull request #14 from leviy/allow-newline-after-concatenation
Allow a newline after a concatenation operator Without this configured, PHPCS will error when concatenation is used for breaking up a long string in multiple lines.
2 parents d3347a0 + ec0bdab commit 209bde5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/LEVIY/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
<rule ref="Squiz.Strings.ConcatenationSpacing">
151151
<properties>
152152
<property name="spacing" value="1"/>
153+
<property name="ignoreNewlines" value="true" />
153154
</properties>
154155
</rule>
155156

tests/correct/concatenation.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
$foo = 'F' . 'oo';
5+
6+
$lipsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ' .
7+
'congue, orci quis dictum blandit, tellus nulla congue urna.';

0 commit comments

Comments
 (0)