Skip to content

Commit 362ce9f

Browse files
authored
Merge pull request #290 from php-school/cs-tools
Upgrade CS tools
2 parents 6b3e058 + 6d17808 commit 362ce9f

File tree

85 files changed

+1508
-1631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1508
-1631
lines changed

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
- name: Install Dependencies
2626
run: composer update --no-interaction --no-progress
2727

28-
- name: Run PHPCS
29-
run: composer run cs
28+
- name: Run cs fixer
29+
run: composer run cs-dry-run
3030

3131
- name: Run PHPStan
3232
run: composer run static

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
2828
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
2929
30-
- name: Install dependencies
30+
- name: Install cdependencies
3131
run: composer update --no-interaction --no-progress
3232

3333
- name: Tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ vendor/
33
/composer.lock
44
/.phpunit.result.cache
55
/.phpunit.cache
6+
/.php-cs-fixer.cache

composer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
],
1616
"require-dev": {
1717
"phpunit/phpunit": "^11.5",
18-
"squizlabs/php_codesniffer": "^3.2",
19-
"phpstan/phpstan": "^1.2.0"
18+
"phpstan/phpstan": "^2.1",
19+
"friendsofphp/php-cs-fixer": "*"
2020
},
2121
"require": {
2222
"php" : ">=8.2",
@@ -37,9 +37,13 @@
3737
"psr-4": { "PhpSchool\\CliMenuTest\\": "test/" }
3838
},
3939
"scripts" : {
40+
"cs-dry-run" : [
41+
"php-cs-fixer check src --rules=@PSR12",
42+
"php-cs-fixer check test --rules=@PSR12"
43+
],
4044
"cs" : [
41-
"phpcs src --standard=PSR2",
42-
"phpcs test --standard=PSR2"
45+
"php-cs-fixer fix src --rules=@PSR12",
46+
"php-cs-fixer fix test --rules=@PSR12"
4347
],
4448
"static" : [
4549
"phpstan analyse src --level=7"

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
parameters:
2-
checkMissingIterableValueType: false

src/Action/ExitAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace PhpSchool\CliMenu\Action;
@@ -10,7 +11,7 @@
1011
*/
1112
class ExitAction
1213
{
13-
public function __invoke(CliMenu $menu) : void
14+
public function __invoke(CliMenu $menu): void
1415
{
1516
$menu->close();
1617
}

src/Action/GoBackAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace PhpSchool\CliMenu\Action;
@@ -10,7 +11,7 @@
1011
*/
1112
class GoBackAction
1213
{
13-
public function __invoke(CliMenu $menu) : void
14+
public function __invoke(CliMenu $menu): void
1415
{
1516
if ($parent = $menu->getParent()) {
1617
$menu->closeThis();

0 commit comments

Comments
 (0)