File tree 3 files changed +35
-0
lines changed
tests/Integration/Fixtures
3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 137
137
use PhpCsFixer \Fixer \Strict \DeclareStrictTypesFixer ;
138
138
use PhpCsFixer \Fixer \Strict \StrictComparisonFixer ;
139
139
use PhpCsFixer \Fixer \Strict \StrictParamFixer ;
140
+ use PhpCsFixer \Fixer \StringNotation \MultilineStringToHeredocFixer ;
140
141
use PhpCsFixer \Fixer \StringNotation \SingleQuoteFixer ;
141
142
use PhpCsFixer \Fixer \Whitespace \ArrayIndentationFixer ;
142
143
use PhpCsFixer \Fixer \Whitespace \BlankLineBeforeStatementFixer ;
386
387
StrictParamFixer::class,
387
388
// Comparisons should be strict, `===` or `!==` must be used for comparisons
388
389
StrictComparisonFixer::class,
390
+ // Convert multiline string to heredoc or nowdoc.
391
+ MultilineStringToHeredocFixer::class,
389
392
// Convert double quotes to single quotes for simple strings
390
393
SingleQuoteFixer::class,
391
394
// 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
63
63
$ baz = implode (', ' , ['foo ' , 'bar ' ]);
64
64
}
65
65
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
+
66
83
// SingleLineCommentSpacingFixer
67
84
// This comment should have space on the beginning
68
85
/* 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
55
55
$ baz = join (', ' , ['foo ' , 'bar ' ]);
56
56
}
57
57
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
+
58
73
// SingleLineCommentSpacingFixer
59
74
//This comment should have space on the beginning
60
75
/*So should this one, also with space on the end*/
You can’t perform that action at this time.
0 commit comments