Skip to content

Commit

Permalink
Try cs fixer with Spiral preset
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Sep 18, 2024
1 parent 093865d commit 48bf8fb
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 217 deletions.
118 changes: 0 additions & 118 deletions .github/workflows/coding-standards.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/cs-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
push:
branches:
- '*'

name: Fix Code Style

jobs:
cs-fix:
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master
21 changes: 5 additions & 16 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
<?php

declare(strict_types=1);

use WayOfDev\PhpCsFixer\Config\ConfigBuilder;
use WayOfDev\PhpCsFixer\Config\RuleSets\ExtendedPERSet;
<?php declare(strict_types=1);

require_once 'vendor/autoload.php';

$config = ConfigBuilder::createFromRuleSet(new ExtendedPERSet())
->inDir(__DIR__ . '/bin')
->inDir(__DIR__ . '/src')
->inDir(__DIR__ . '/tests')
->addFiles([__FILE__])
->getConfig();

$config->setCacheFile(__DIR__ . '/runtime/php-cs-fixer/php-cs-fixer.cache');

return $config;
return \Spiral\CodeStyle\Builder::create()
->include(__DIR__ . '/src')
->include(__FILE__)
->build();
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"buggregator/trap": "^1.10",
"friendsofphp/php-cs-fixer": "^3.64",
"phpunit/phpunit": "^10.5",
"spiral/code-style": "^2.0",
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
"vimeo/psalm": "^5.25",
"wayofdev/cs-fixer-config": "^1.4"
"vimeo/psalm": "^5.25"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
138 changes: 57 additions & 81 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48bf8fb

Please sign in to comment.