Skip to content

Commit

Permalink
[CodingStyle] Use str_starts_with() on isName($node, 'test*') on Data…
Browse files Browse the repository at this point in the history
…ProviderArrayItemsNewlinedRector (#4988)

* [CodingStyle] Use str_starts_with() on isName($node, 'test*') on DataProviderArrayItemsNewlinedRector

* add fixture to skip test method
  • Loading branch information
samsonasik committed Sep 11, 2023
1 parent b3639f7 commit bfb7590
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Rector\Tests\CodingStyle\Rector\ClassMethod\DataProviderArrayItemsNewlinedRector\Fixture;

use PHPUnit\Framework\TestCase;

final class SkipTestMethod extends TestCase
{
public function test(): array
{
return [['content', 8], ['content123', 11]];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function refactor(Node $node): ?Node
}

// skip test methods
if ($this->isName($node, 'test*')) {
if (str_starts_with($node->name->toString(), 'test')) {
return null;
}

Expand Down

0 comments on commit bfb7590

Please sign in to comment.