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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,14 @@ jobs:
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi

- name: Rector Cache
uses: actions/cache@v4
with:
path: /tmp/rector
key: ${{ runner.os }}-rector-${{ github.run_id }}
restore-keys: ${{ runner.os }}-rector-

- run: mkdir -p /tmp/rector

- name: Analyze for refactoring
run: vendor/bin/rector process --dry-run --no-progress-bar
7 changes: 7 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
Expand Down Expand Up @@ -50,6 +51,12 @@

$rectorConfig->parallel();

// Github action cache
$rectorConfig->cacheClass(FileCacheStorage::class);
if (is_dir('/tmp')) {
$rectorConfig->cacheDirectory('/tmp/rector');
}

// The paths to refactor (can also be supplied with CLI arguments)
$rectorConfig->paths([
__DIR__ . '/src/',
Expand Down
9 changes: 9 additions & 0 deletions src/Template/.github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,14 @@ jobs:
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi

- name: Rector Cache
uses: actions/cache@v4
with:
path: /tmp/rector
key: ${{ runner.os }}-rector-${{ github.run_id }}
restore-keys: ${{ runner.os }}-rector-

- run: mkdir -p /tmp/rector

- name: Analyze for refactoring
run: vendor/bin/rector process --dry-run --no-progress-bar
7 changes: 7 additions & 0 deletions src/Template/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
Expand Down Expand Up @@ -50,6 +51,12 @@

$rectorConfig->parallel();

// Github action cache
$rectorConfig->cacheClass(FileCacheStorage::class);
if (is_dir('/tmp')) {
$rectorConfig->cacheDirectory('/tmp/rector');
}

// The paths to refactor (can also be supplied with CLI arguments)
$rectorConfig->paths([
__DIR__ . '/app/',
Expand Down