Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare Sulu 2.6 ruleset #26

Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
SuluLevelSetList::UP_TO_SULU_25,
SuluLevelSetList::UP_TO_SULU_26,
]);
};
```
11 changes: 11 additions & 0 deletions config/sets/sulu/level/up-to-sulu-26.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Sulu\Rector\Set\SuluLevelSetList;
use Sulu\Rector\Set\SuluSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([SuluSetList::SULU_26, SuluLevelSetList::UP_TO_SULU_25]);
};
8 changes: 8 additions & 0 deletions config/sets/sulu/sulu-26.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
};
5 changes: 5 additions & 0 deletions src/Set/SuluLevelSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ final class SuluLevelSetList implements SetListInterface
* @var string
*/
final public const UP_TO_SULU_25 = __DIR__ . '/../../config/sets/sulu/level/up-to-sulu-25.php';

/**
* @var string
*/
final public const UP_TO_SULU_26 = __DIR__ . '/../../config/sets/sulu/level/up-to-sulu-26.php';
}
5 changes: 5 additions & 0 deletions src/Set/SuluSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ final class SuluSetList implements SetListInterface
* @var string
*/
final public const SULU_25 = __DIR__ . '/../../config/sets/sulu/sulu-25.php';

/**
* @var string
*/
final public const SULU_26 = __DIR__ . '/../../config/sets/sulu/sulu-26.php';
}
2 changes: 1 addition & 1 deletion tests/Set/Sulu25/Sulu25Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Sulu\Rector\Tests\Set\Sulu24;
namespace Sulu\Rector\Tests\Set\Sulu25;

use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;
Expand Down
Empty file.
32 changes: 32 additions & 0 deletions tests/Set/Sulu26/Sulu26Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Sulu\Rector\Tests\Set\Sulu26;

use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

final class Sulu26Test extends AbstractRectorTestCase
{
/**
* @dataProvider provideData()
*/
public function test(string $fileInfo): void
{
$this->doTestFile($fileInfo);
}

/**
* @return \Iterator<SmartFileInfo>
*/
public function provideData(): \Iterator
{
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

public function provideConfigFilePath(): string
{
return __DIR__ . '/config/sulu-26.php';
}
}
11 changes: 11 additions & 0 deletions tests/Set/Sulu26/config/sulu-26.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Sulu\Rector\Set\SuluSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../config/config.php');
$rectorConfig->sets([SuluSetList::SULU_26]);
};
Loading