diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 2998407dd5d..c0cca8b0baa 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -21,6 +21,6 @@ parameters: - message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#' path: tests - count: 1021 + count: 1020 tipsOfTheDay: false tmpDir: dev-tools/phpstan/cache diff --git a/src/Fixer/Whitespace/StatementIndentationFixer.php b/src/Fixer/Whitespace/StatementIndentationFixer.php index 783ec506397..101f142ff48 100644 --- a/src/Fixer/Whitespace/StatementIndentationFixer.php +++ b/src/Fixer/Whitespace/StatementIndentationFixer.php @@ -106,7 +106,7 @@ public function getPriority(): int public function isCandidate(Tokens $tokens): bool { - return true; + return $tokens->isMonolithicPhp(); } protected function createConfigurationDefinition(): FixerConfigurationResolverInterface diff --git a/tests/Fixer/Basic/BracesFixerTest.php b/tests/Fixer/Basic/BracesFixerTest.php index 10606ebf314..9587f16d269 100644 --- a/tests/Fixer/Basic/BracesFixerTest.php +++ b/tests/Fixer/Basic/BracesFixerTest.php @@ -1404,7 +1404,7 @@ function mixedComplex() yield [ 'x', 'x', ]; @@ -2437,7 +2437,7 @@ function mixedComplex() yield [ 'x', 'x', self::CONFIGURATION_OOP_POSITION_SAME_LINE, @@ -3234,10 +3234,6 @@ public static function provideFixCommentBeforeBraceCases(): iterable yield [ '', - '', @@ -5418,63 +5414,6 @@ public static function provideMessyWhitespacesCases(): iterable ]; } - /** - * @dataProvider provideNowdocInTemplatesCases - */ - public function testNowdocInTemplates(string $expected, ?string $input = null): void - { - $this->doTest($expected, $input); - } - - public static function provideNowdocInTemplatesCases(): iterable - { - yield [ - <<<'EOT' - - - - - X X ', ' X ', ]; @@ -5843,25 +5782,25 @@ public static function provideFixAlternativeSyntaxCases(): iterable yield [ ' +foreach ($b as $c): ?> + for (;;): ?> + foreach ($b as $c): ?> + for (;;): ?> + while ($b): ?> + while ($b): ?> + foreach ($b as $c): ?> + for (;;): ?> + while ($b): ?> + while ($b): ?>