Skip to content

Commit fe2538d

Browse files
Switch to ECS and minimum of PHP 8.0
1 parent 78e2745 commit fe2538d

File tree

10 files changed

+50
-39
lines changed

10 files changed

+50
-39
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ features/ export-ignore
55
test/ export-ignore
66
.gitattributes export-ignore
77
.gitignore export-ignore
8-
.php_cs export-ignore
98
CONTRIBUTING.md export-ignore
109
docker-compose.yml export-ignore
1110
ecs.php export-ignore

.github/workflows/code-style.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
actions:
1515
-
1616
name: "Code style"
17-
run: vendor/bin/php-cs-fixer fix -v --diff --dry-run
17+
run: vendor/bin/ecs check --ansi
1818
php-versions: ['7.4']
1919

2020
name: ${{ matrix.actions.name }}

.php_cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
If you want to contribute to this library, clone this project, then:
22

33
- Run `bin/install` to download relevant Docker images and install Composer dependencies.
4-
- Run `bin/fix` to fix code style issues
4+
- Run `bin/fix-cs` to fix code style issues
55
- Run `bin/test` to run the tests

bin/fix-cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
docker-compose run --rm php php vendor/bin/ecs check --fix

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@
2323
}
2424
},
2525
"require": {
26-
"php": ">=7.4",
26+
"php": ">=8.0",
2727
"symfony/form": "~5.0",
2828
"symfony/console": "~5.0",
2929
"symfony/translation": "~5.0"
3030
},
3131
"require-dev": {
3232
"beberlei/assert": "~2.1",
3333
"behat/behat": "^3.6",
34-
"friendsofphp/php-cs-fixer": "^2.2",
3534
"symfony/finder": "~5.0",
3635
"symfony/framework-bundle": "~5.0",
3736
"symfony/validator": "~5.0",
3837
"symfony/yaml": "~5.0",
3938
"symfony/security-csrf": "~5.0",
40-
"phpunit/phpunit": "^9.5"
39+
"phpunit/phpunit": "^9.5",
40+
"symplify/easy-coding-standard": "^9.4",
41+
"symplify/coding-standard": "^9.4"
4142
}
4243
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
user: ${HOST_UID}:${HOST_GID}
1212

1313
php:
14-
image: php:7.4-cli-alpine
14+
image: php:8.0-cli-alpine
1515
working_dir: /app
1616
volumes:
1717
- ./:/app

ecs.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
use Symplify\EasyCodingStandard\ValueObject\Option;
7+
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
8+
9+
return static function (
10+
ContainerConfigurator $containerConfigurator
11+
): void {
12+
$parameters = $containerConfigurator->parameters();
13+
$parameters->set(
14+
Option::PATHS,
15+
[
16+
__DIR__ . '/src',
17+
__DIR__ . '/test'
18+
]
19+
);
20+
21+
$parameters->set(
22+
Option::SKIP,
23+
[
24+
__DIR__ . '/test/temp'
25+
]
26+
);
27+
28+
$containerConfigurator->import(SetList::CONTROL_STRUCTURES);
29+
$containerConfigurator->import(SetList::PSR_12);
30+
$containerConfigurator->import(SetList::COMMON);
31+
$containerConfigurator->import(SetList::SYMPLIFY);
32+
};

src/Bundle/SymfonyConsoleFormBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
final class SymfonyConsoleFormBundle extends Bundle
99
{
10-
public function getContainerExtension()
10+
public function getContainerExtension(): SymfonyConsoleFormExtension
1111
{
1212
return new SymfonyConsoleFormExtension();
1313
}

test/AppKernel.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@
99

1010
class AppKernel extends Kernel
1111
{
12-
public function registerBundles()
12+
public function registerBundles(): array
1313
{
1414
return [
1515
new FrameworkBundle(),
1616
new SymfonyConsoleFormBundle(),
1717
];
1818
}
1919

20-
public function registerContainerConfiguration(LoaderInterface $loader)
20+
public function registerContainerConfiguration(LoaderInterface $loader): void
2121
{
2222
$loader->load(__DIR__.'/config.yml');
2323
}
2424

25-
public function getProjectDir()
25+
public function getProjectDir(): string
2626
{
2727
return __DIR__;
2828
}
2929

30-
public function getCacheDir()
30+
public function getCacheDir(): string
3131
{
3232
return __DIR__.'/temp/cache';
3333
}
3434

35-
public function getLogDir()
35+
public function getLogDir(): string
3636
{
3737
return __DIR__.'/temp/logs';
3838
}

0 commit comments

Comments
 (0)