Skip to content

Commit 76e0818

Browse files
committed
Try cs fixer with Spiral preset
1 parent 093865d commit 76e0818

File tree

5 files changed

+76
-217
lines changed

5 files changed

+76
-217
lines changed

.github/workflows/coding-standards.yml

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

.github/workflows/cs-fix.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on:
2+
push:
3+
branches:
4+
- '*'
5+
6+
name: Fix Code Style
7+
8+
jobs:
9+
cs-fix:
10+
permissions:
11+
contents: write
12+
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master

.php-cs-fixer.dist.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
<?php
2-
3-
declare(strict_types=1);
4-
5-
use WayOfDev\PhpCsFixer\Config\ConfigBuilder;
6-
use WayOfDev\PhpCsFixer\Config\RuleSets\ExtendedPERSet;
1+
<?php declare(strict_types=1);
72

83
require_once 'vendor/autoload.php';
94

10-
$config = ConfigBuilder::createFromRuleSet(new ExtendedPERSet())
11-
->inDir(__DIR__ . '/bin')
12-
->inDir(__DIR__ . '/src')
13-
->inDir(__DIR__ . '/tests')
14-
->addFiles([__FILE__])
15-
->getConfig();
16-
17-
$config->setCacheFile(__DIR__ . '/runtime/php-cs-fixer/php-cs-fixer.cache');
18-
19-
return $config;
5+
return \Spiral\CodeStyle\Builder::create()
6+
->include(__DIR__ . '/src')
7+
->include(__FILE__)
8+
->build();

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"buggregator/trap": "^1.10",
3434
"friendsofphp/php-cs-fixer": "^3.64",
3535
"phpunit/phpunit": "^10.5",
36+
"spiral/code-style": "^2.0",
3637
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
37-
"vimeo/psalm": "^5.25",
38-
"wayofdev/cs-fixer-config": "^1.4"
38+
"vimeo/psalm": "^5.25"
3939
},
4040
"minimum-stability": "dev",
4141
"prefer-stable": true,

composer.lock

Lines changed: 57 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)