|
@@ -20,10 +20,9 @@ use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
|
|
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
|
|
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
|
|
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
|
|
+use PhpCsFixer\FixerDefinition\CodeSample;
|
|
|
use PhpCsFixer\FixerDefinition\FixerDefinition;
|
|
|
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
|
|
-use PhpCsFixer\FixerDefinition\VersionSpecification;
|
|
|
-use PhpCsFixer\FixerDefinition\VersionSpecificCodeSample;
|
|
|
use PhpCsFixer\Preg;
|
|
|
use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer;
|
|
|
use PhpCsFixer\Tokenizer\Token;
|
|
@@ -37,43 +36,33 @@ final class HeredocIndentationFixer extends AbstractFixer implements Configurabl
|
|
|
public function getDefinition(): FixerDefinitionInterface
|
|
|
{
|
|
|
return new FixerDefinition(
|
|
|
- 'Heredoc/nowdoc content must be properly indented. Requires PHP >= 7.3.',
|
|
|
+ 'Heredoc/nowdoc content must be properly indented.',
|
|
|
[
|
|
|
- new VersionSpecificCodeSample(
|
|
|
+ new CodeSample(
|
|
|
<<<'SAMPLE'
|
|
|
<?php
|
|
|
- $a = <<<EOD
|
|
|
+ $heredoc = <<<EOD
|
|
|
abc
|
|
|
def
|
|
|
EOD;
|
|
|
|
|
|
- SAMPLE
|
|
|
- ,
|
|
|
- new VersionSpecification(7_03_00)
|
|
|
- ),
|
|
|
- new VersionSpecificCodeSample(
|
|
|
- <<<'SAMPLE'
|
|
|
- <?php
|
|
|
- $a = <<<'EOD'
|
|
|
+ $nowdoc = <<<'EOD'
|
|
|
abc
|
|
|
def
|
|
|
EOD;
|
|
|
|
|
|
SAMPLE
|
|
|
- ,
|
|
|
- new VersionSpecification(7_03_00)
|
|
|
),
|
|
|
- new VersionSpecificCodeSample(
|
|
|
+ new CodeSample(
|
|
|
<<<'SAMPLE'
|
|
|
<?php
|
|
|
- $a = <<<'EOD'
|
|
|
+ $nowdoc = <<<'EOD'
|
|
|
abc
|
|
|
def
|
|
|
EOD;
|
|
|
|
|
|
SAMPLE
|
|
|
,
|
|
|
- new VersionSpecification(7_03_00),
|
|
|
['indentation' => 'same_as_start']
|
|
|
),
|
|
|
]
|