Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/multiple.php.inc'];
yield [__DIR__ . '/Fixture/duplicate.php.inc'];
yield [__DIR__ . '/Fixture/skip_scalars.php.inc'];
yield [__DIR__ . '/Fixture/skip_non_action_methods.php.inc'];
yield [__DIR__ . '/Fixture/only_props_from_this.php.inc'];
yield [__DIR__ . '/Fixture/manage_different_naming.php.inc'];
yield [__DIR__ . '/Fixture/extra_calls_in_constructor.inc.php'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

namespace Rector\BetterPhpDocParser\Tests\PhpDocInfo\PhpDocInfoPrinter;

use Iterator;
use PhpParser\Comment\Doc;
use PhpParser\Node;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\BetterPhpDocParser\Printer\PhpDocInfoPrinter;
use Rector\HttpKernel\RectorKernel;
use Rector\Testing\StaticFixtureProvider;
use Symplify\PackageBuilder\Tests\AbstractKernelTestCase;

abstract class AbstractPhpDocInfoPrinterTest extends AbstractKernelTestCase
Expand Down Expand Up @@ -38,4 +40,9 @@ protected function createPhpDocInfoFromDocCommentAndNode(string $docComment, Nod

return $this->phpDocInfoFactory->createFromNode($node);
}

protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php'): Iterator
{
return StaticFixtureProvider::yieldFilesFromDirectory($directory, $suffix);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,7 @@ public function test(string $docFilePath): void

public function provideData(): Iterator
{
yield [__DIR__ . '/Source/Basic/doc.txt'];
yield [__DIR__ . '/Source/Basic/doc2.txt'];
yield [__DIR__ . '/Source/Basic/doc3.txt'];
yield [__DIR__ . '/Source/Basic/doc4.txt'];
yield [__DIR__ . '/Source/Basic/doc5.txt'];
yield [__DIR__ . '/Source/Basic/doc6.txt'];
yield [__DIR__ . '/Source/Basic/doc7.txt'];
yield [__DIR__ . '/Source/Basic/doc8.txt'];
yield [__DIR__ . '/Source/Basic/doc9.txt'];
yield [__DIR__ . '/Source/Basic/doc10.txt'];
yield [__DIR__ . '/Source/Basic/doc11.txt'];
yield [__DIR__ . '/Source/Basic/doc13.txt'];
yield [__DIR__ . '/Source/Basic/doc14.txt'];
yield [__DIR__ . '/Source/Basic/doc15.txt'];
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureBasic', '*.txt');
}

/**
Expand All @@ -52,6 +39,6 @@ public function testEmpty(string $docFilePath): void

public function provideDataEmpty(): Iterator
{
yield [__DIR__ . '/Source/Basic/empty-doc.txt'];
return $this->yieldFilesFromDirectory(__DIR__ . '/FixtureEmpty', '*.txt');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
yield [__DIR__ . '/Fixture/fixture3.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public function test(string $file): void
*/
public function provideDataForTest(): iterable
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/or.php.inc'];
yield [__DIR__ . '/Fixture/and.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/assign.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

/**
* @see https://3v4l.org/aLf96
* @see https://3v4l.org/2r26K
* @see https://3v4l.org/anks3
*
* @see \Rector\CodeQuality\Tests\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector\ArrayMergeOfNonArraysToSimpleArrayRectorTest
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/skip.php.inc'];
yield [__DIR__ . '/Fixture/another_class.php.inc'];
yield [__DIR__ . '/Fixture/skip_another_class.php.inc'];
yield [__DIR__ . '/Fixture/skip_empty_first_array.php.inc'];
yield [__DIR__ . '/Fixture/skip_as_well.php.inc'];
yield [__DIR__ . '/Fixture/no_return_for_void.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/binary_and.php.inc'];
yield [__DIR__ . '/Fixture/multi_binary.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
yield [__DIR__ . '/Fixture/fixture3.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/multiple_types.php.inc'];
yield [__DIR__ . '/Fixture/skip_anonymous_class.php.inc'];
yield [__DIR__ . '/Fixture/skip_defined.php.inc'];
yield [__DIR__ . '/Fixture/skip_parent_property.php.inc'];
yield [__DIR__ . '/Fixture/skip_trait_used.php.inc'];
yield [__DIR__ . '/Fixture/skip_magic_parent.php.inc'];
yield [__DIR__ . '/Fixture/skip_magic.php.inc'];
yield [__DIR__ . '/Fixture/skip_laravel_closure_binding.php.inc'];
yield [__DIR__ . '/Fixture/skip_dynamic_properties.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/skip_longer_than_120.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/skip_objects.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/for_with_count.php.inc'];
yield [__DIR__ . '/Fixture/for_with_switched_compare.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
yield [__DIR__ . '/Fixture/fixture3.php.inc'];
yield [__DIR__ . '/Fixture/fixture4.php.inc'];
yield [__DIR__ . '/Fixture/skip_collections.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/skip.php.inc'];
yield [__DIR__ . '/Fixture/skip_if_else.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/fixture2.php.inc'];
yield [__DIR__ . '/Fixture/fixture3.php.inc'];
yield [__DIR__ . '/Fixture/foreach_key_value.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/skip.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
// https://3v4l.org/2r26K
yield [__DIR__ . '/Fixture/nested_arrays.php.inc'];
// skip multiple items https://3v4l.org/anks3
yield [__DIR__ . '/Fixture/skip_non_arrays.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
yield [__DIR__ . '/Fixture/pattern_in_constant.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(string $file): void

public function provideDataForTest(): Iterator
{
yield [__DIR__ . '/Fixture/fixture.php.inc'];
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

protected function getRectorClass(): string
Expand Down
Loading