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
28 changes: 28 additions & 0 deletions resources/docs/troubleshooting-preload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
On some dependency with CLI command, eg: PHPUnit 12+, you may got error:

```bash
PHP Fatal error: Cannot declare interface PhpParser\NodeVisitor, because the name is already in use in /home/runner/work/rector-rules/rector-rules/vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php on line 6
```

which its own autoload too early loaded, you may need to handle it with register `rector` preload.php under `"autoload-dev" -> "files"` like below:

```json
{
"autoload-dev": {
"psr-4": {
"Your\\Test\\": "tests/"
},
"files": [
"vendor/rector/rector/preload.php"
]
}
}
```

then, run:

```bash
composer update
```

and verify it resolved.
4 changes: 4 additions & 0 deletions src/Documentation/DocumentationMenuFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function create(): array
'troubleshooting-parallel',
'Troubleshooting Parallel'
),
$this->documentationMenuItemFactory->createSection(
'troubleshooting-preload',
'Troubleshooting Preload PHPParser and PHPStan PHPDoc Parser'
),
$this->documentationMenuItemFactory->createSection(
'reporting-issue-with-rector',
'Reporting Issue With Rector'
Expand Down