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

Test against PHP 8, allow ECS 9 & upgrade config to PHP file #34

Merged
merged 1 commit into from Mar 19, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
@@ -1,13 +1,12 @@
language: php

php:
- 7.2
- 7.3
- 7.4
- 8.0

env:
- ECS_VERSION="^7.0"
- ECS_VERSION="^8.0"
- ECS_VERSION="^9.0"

cache:
directories:
Expand All @@ -22,4 +21,4 @@ install:
script:
- composer validate --strict

- vendor/bin/ecs check tests
- vendor/bin/ecs check --config ecs.php tests ecs.php
24 changes: 20 additions & 4 deletions README.md
Expand Up @@ -13,9 +13,25 @@ Installation & usage
$ composer require --dev sylius-labs/coding-standard
```

2. Include a configuration file in your `easy-coding-standard.yml`:
2. Import the configuration file in your `ecs.php`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecs.php -> easy-coding-standard.php? no need to change the name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but as we are changing the extension already, I figured we can follow the official ECS docs for the filename: https://github.com/symplify/easy-coding-standard#usage


```yml
imports:
- { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' }
```php
$containerConfigurator->import('vendor/sylius-labs/coding-standard/easy-coding-standard.php');
```

Example config (ecs.php)
------------------------

```php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/sylius-labs/coding-standard/easy-coding-standard.php');
};
```

Upgrade from YML to PHP config file
-----------------------------------

Use this [package](https://github.com/symplify/config-transformer) and follow their guidelines
to automatically migrate your YML config to a PHP config file.
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -10,9 +10,9 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.3 || ^8.0",
"slevomat/coding-standard": "^6.3",
"symplify/easy-coding-standard": "^7.3 || ^8.1"
"symplify/easy-coding-standard": "^9.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
166 changes: 0 additions & 166 deletions easy-coding-standard.yml

This file was deleted.