File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
tests/Integration/Fixtures Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 137137use PhpCsFixer \Fixer \Strict \DeclareStrictTypesFixer ;
138138use PhpCsFixer \Fixer \Strict \StrictComparisonFixer ;
139139use PhpCsFixer \Fixer \Strict \StrictParamFixer ;
140+ use PhpCsFixer \Fixer \StringNotation \MultilineStringToHeredocFixer ;
140141use PhpCsFixer \Fixer \StringNotation \SingleQuoteFixer ;
141142use PhpCsFixer \Fixer \Whitespace \ArrayIndentationFixer ;
142143use PhpCsFixer \Fixer \Whitespace \BlankLineBeforeStatementFixer ;
386387 StrictParamFixer::class,
387388 // Comparisons should be strict, `===` or `!==` must be used for comparisons
388389 StrictComparisonFixer::class,
390+ // Convert multiline string to heredoc or nowdoc.
391+ MultilineStringToHeredocFixer::class,
389392 // Convert double quotes to single quotes for simple strings
390393 SingleQuoteFixer::class,
391394 // Each element of an array must be indented exactly once.
Original file line number Diff line number Diff line change @@ -63,6 +63,23 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
6363 $ baz = implode (', ' , ['foo ' , 'bar ' ]);
6464 }
6565
66+ // HeredocIndentationFixer
67+ $ heredoc = <<<HEREDOC
68+ This is a
69+ multiline heredoc string. It contains $ foo.
70+ It should be indented, though.
71+ HEREDOC ;
72+ // HeredocIndentationFixer
73+ $ newdoc = <<<'NEWDOC'
74+ This is a $newdoc, where variables are not expanded.
75+ NEWDOC;
76+ // MultilineStringToHeredocFixer
77+ $ multilineString = <<<'EOD'
78+ This string
79+ spans multiple lines
80+ but should be heredoc instead
81+ EOD;
82+
6683 // SingleLineCommentSpacingFixer
6784 // This comment should have space on the beginning
6885 /* So should this one, also with space on the end */
Original file line number Diff line number Diff line change @@ -55,6 +55,21 @@ class Basic extends \Some\Other\Namespace\AbstractBasic implements \Lmc\CodingSt
5555 $ baz = join (', ' , ['foo ' , 'bar ' ]);
5656 }
5757
58+ // HeredocIndentationFixer
59+ $ heredoc = <<<HEREDOC
60+ This is a
61+ multiline heredoc string. It contains $ foo.
62+ It should be indented, though.
63+ HEREDOC ;
64+ // HeredocIndentationFixer
65+ $ newdoc = <<<'NEWDOC'
66+ This is a $newdoc, where variables are not expanded.
67+ NEWDOC;
68+ // MultilineStringToHeredocFixer
69+ $ multilineString = 'This string
70+ spans multiple lines
71+ but should be heredoc instead ' ;
72+
5873 // SingleLineCommentSpacingFixer
5974 //This comment should have space on the beginning
6075 /*So should this one, also with space on the end*/
You can’t perform that action at this time.
0 commit comments