Skip to content

Commit

Permalink
Test against PHP 8, allow ECS 9, upgrade config to PHP file
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandoorn committed Feb 19, 2021
1 parent 5fdbf84 commit c06da2a
Show file tree
Hide file tree
Showing 5 changed files with 417 additions and 174 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,13 +1,14 @@
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 +23,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`:

```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": "^7.3 || ^8.1 || ^9.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
166 changes: 0 additions & 166 deletions easy-coding-standard.yml

This file was deleted.

0 comments on commit c06da2a

Please sign in to comment.