-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TokenRunner] Handle crash on BlockFinder when using LineLengthFixer …
…+ NewWithParenthesesFixer (#45)
- Loading branch information
1 parent
50599e1
commit abd81d4
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php declare(strict_types=1); | ||
|
||
final class LineLengtParentheses | ||
{ | ||
public function __construct( | ||
private DateTimeImmutable $dateTimeImmutable = new DateTimeImmutable() | ||
) {} | ||
} | ||
|
||
?> | ||
----- | ||
<?php declare(strict_types=1); | ||
|
||
final class LineLengtParentheses | ||
{ | ||
public function __construct( | ||
private DateTimeImmutable $dateTimeImmutable = new DateTimeImmutable | ||
) {} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symplify\CodingStandard\Tests\Issues; | ||
|
||
use Iterator; | ||
use PHPUnit\Framework\Attributes\DataProvider; | ||
use Symplify\EasyCodingStandard\Testing\PHPUnit\AbstractCheckerTestCase; | ||
|
||
final class LineLengthParenthesesTest extends AbstractCheckerTestCase | ||
{ | ||
#[DataProvider('provideData')] | ||
public function test(string $filePath): void | ||
{ | ||
$this->doTestFile($filePath); | ||
} | ||
|
||
public static function provideData(): Iterator | ||
{ | ||
yield [__DIR__ . '/Fixture/line_length_parentheses.php.inc']; | ||
} | ||
|
||
public function provideConfig(): string | ||
{ | ||
return __DIR__ . '/config/line_length_parentheses.php'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer; | ||
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
|
||
return static function (ECSConfig $ecsConfig): void { | ||
$ecsConfig->rules([ | ||
LineLengthFixer::class, | ||
]); | ||
|
||
$ecsConfig->ruleWithConfiguration(NewWithParenthesesFixer::class, [ | ||
'anonymous_class' => false, | ||
'named_class' => false, | ||
]); | ||
}; |