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 phpcs.md #620

Merged
merged 1 commit into from
Apr 3, 2019
Merged
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
24 changes: 23 additions & 1 deletion doc/tasks/phpcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ parameters:

### Magento

If you want to use Phpcs for your Magento projects, you can require the magento-ecg repo.
If you want to use Phpcs for your Magento projects, you can require the magento-ecg repo ( works with Magento 1 and Magento 2 ).

```sh
composer require --dev magento-ecg/coding-standard
Expand All @@ -162,6 +162,28 @@ parameters:
warning_severity: 0
```

For Magento 2 projects, you can require the Magento Coding Standard repo.
```sh
composer require --dev magento/magento-coding-standard
```

Next, add the following to your `composer.json` file, and run `composer run-script post-install-cmd`.
```sh
"scripts": {
"post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/",
"post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/"
}
```

Following this, you can add the path to your phpcs task.
```yaml
# gumphp.yml
parameters:
tasks:
phpcs:
standard: "Magento2"
```

### Drupal

If you want to use Phpcs for your Drupal projects, you can require the Drupal Code Sniffer (Coder)
Expand Down