• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valkyrjaio / ci-rector-php / 30722246915
100%

Build:
DEFAULT BRANCH: 26.x
Ran 01 Aug 2026 10:54PM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Aug 2026 10:53PM UTC coverage: 100.0%. Remained the same
30722246915

push

github

web-flow
[Rector] fix: Give each project its own cache directory (#159)

# Description

Rector fails in one repository with an error that names a directory in
another
repository:

```
[ERROR] Could not process "../../../src/Rector/CodingStyle/Rector/Stmt/RemoveNonConflictingAliasInUseStatementRector.php"
file, due to: ""phar:///…/php/template/.worktrees/info-test-format/.github/ci/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/…/soap.stub"
is not a file". On line: 20
```

The path belongs to a git worktree of a different repository, and the
developer
never analyzed it.

## The cause

Rector gives every project on a machine **one** cache directory in the
system
temp directory. The compiled container is the part that breaks. It holds
an
absolute path into the `vendor` directory of whichever project compiled
it
first, and that path reaches inside `phpstan.phar`. Every later project
then
loads a container that points at a directory it does not own. Nothing
fails
while that directory exists. The error appears when the first project
moves or
goes away, and a git worktree makes that ordinary, because a developer
removes a
worktree when the work ends.

The file cache is not the cause. I isolated it first and the failure
stayed, and
the stale path then named a third repository.

## The fix

`Rules::getConfig()` now passes both a `cacheDirectory` and a
`containerCacheDirectory`, below one directory per project.

The name comes from `__DIR__`. Composer installs this package into the
`vendor`
directory of each project, so `__DIR__` already identifies one project.
It also
stays correct when a developer runs Rector from another directory, and
it is
always a `string`, so the code carries no branch that a test cannot
reach.

`mkdir` is required rather than optional: Rector rejects a container
cache
directory that does not already exist.

Each project keeps a warm cache, so the change costs no speed after the
first
run.

## Types of changes

-... (continued)

9 of 0 new or added lines in 0 files covered. (NaN%)

146 of 146 relevant lines covered (100.0%)

7.76 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30722246915.1 01 Aug 2026 10:54PM UTC 3
100.0
GitHub Action Run
Source Files on build 30722246915
  • Tree
  • List 3
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30722246915
  • d388c825 on github
  • Prev Build on 26.x (#30718487759)
  • Next Build on 26.x (#30722305826)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc