Skip to content

Commit

Permalink
Merge pull request #330 from rectorphp/php-parser-v4
Browse files Browse the repository at this point in the history
Update to PHP-Parser v4
  • Loading branch information
Tomáš Votruba authored Apr 2, 2018
2 parents a503e19 + 84f3574 commit 0c835da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ Rector can:
## Install

```bash
composer require --dev rector/rector:'dev-master' nikic/php-parser:'4.0.x-dev'
composer require --dev rector/rector:'dev-master'
```

### Do you Have Conflicts?

It may also happen your dependencies are in conflict, e.g. [PHPStan](https://github.com/phpstan/phpstan) requires [PHP-Parser](https://github.com/nikic/PHP-Parser) version 3, or older PHPUnit etc. This might be solved in the future, when PHP-Parser version 4 becomes stable.

Since Rector **uses project's autoload to analyze type of elements**, it cannot be installed as project in standalone directory but **needs to be added as dependency**. Here [`bamarni/composer-bin-plugin`](https://github.com/bamarni/composer-bin-plugin) becomes useful:

```bash
Expand All @@ -51,7 +49,7 @@ composer require bamarni/composer-bin-plugin --dev
Then, require Rector using `composer bin`:

```bash
composer bin rector require --dev rector/rector:'dev-master' nikic/php-parser:'4.0.x-dev'
composer bin rector require --dev rector/rector:'dev-master'
```

And Rector is accessible as:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"jean85/pretty-package-versions": "^1.1",
"nette/robot-loader": "^3.0",
"nette/utils": "^2.5",
"nikic/php-parser": "4.0.x-dev",
"nikic/php-parser": "^4.0",
"phpdocumentor/reflection-docblock": "^4.3",
"phpdocumentor/type-resolver": "^0.4",
"rector/better-reflection": "^4.0",
Expand Down

0 comments on commit 0c835da

Please sign in to comment.