Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to PHP-Parser v4 #330

Merged
merged 3 commits into from
Apr 2, 2018
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
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