Skip to content

Commit

Permalink
Update to PHP-Parser v4
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel committed Mar 7, 2018
1 parent e5f89ec commit 6901664
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"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": "^3.0.6",
"roave/better-reflection": "dev-master",
"sebastian/diff": "^3.0",
"symfony/console": "^4.0",
"symfony/dependency-injection": "^4.0",
Expand Down

0 comments on commit 6901664

Please sign in to comment.