Skip to content

Commit 628f8bb

Browse files
authored
feat: add cs-fixer (#230)
* feat: add cs-fixer * ci: add php-cs-fixer job
1 parent cc69fcd commit 628f8bb

65 files changed

Lines changed: 169 additions & 108 deletions

File tree

Some content is hidden

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

.github/workflows/code-style.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Code Style
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
php-cs-fixer:
10+
uses: FriendsOfShopware/actions/.github/workflows/php-cs-fixer.yml@main

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@
4141
"allow-plugins": {
4242
"symfony/runtime": true
4343
}
44+
},
45+
"scripts": {
46+
"cs-fix": "docker run --rm -v $(pwd):$(pwd) -w $(pwd) oskarstark/php-cs-fixer-ga --rules @PER-CS2.0,@PER-CS2.0:risky --allow-risky=yes ."
4447
}
4548
}

src/Command/ChangeUserPasswordCommand.php

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

45
namespace Frosh\Tools\Command;

src/Command/DevRobotsTxtCommand.php

Lines changed: 3 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 Frosh\Tools\Command;
@@ -15,7 +16,8 @@
1516
class DevRobotsTxtCommand extends Command
1617
{
1718
public function __construct(
18-
#[Autowire('%kernel.project_dir%/public')] private readonly string $envPath
19+
#[Autowire('%kernel.project_dir%/public')]
20+
private readonly string $envPath
1921
) {
2022
parent::__construct();
2123
}

src/Command/EnvDelCommand.php

Lines changed: 3 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 Frosh\Tools\Command;
@@ -16,7 +17,8 @@
1617
class EnvDelCommand extends Command
1718
{
1819
public function __construct(
19-
#[Autowire('%kernel.project_dir%/.env')] private readonly string $envPath
20+
#[Autowire('%kernel.project_dir%/.env')]
21+
private readonly string $envPath
2022
) {
2123
parent::__construct();
2224
}

src/Command/EnvGetCommand.php

Lines changed: 3 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 Frosh\Tools\Command;
@@ -17,7 +18,8 @@
1718
class EnvGetCommand extends Command
1819
{
1920
public function __construct(
20-
#[Autowire('%kernel.project_dir%/.env')] private readonly string $envPath
21+
#[Autowire('%kernel.project_dir%/.env')]
22+
private readonly string $envPath
2123
) {
2224
parent::__construct();
2325
}

src/Command/EnvListCommand.php

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

45
namespace Frosh\Tools\Command;
56

67
use Symfony\Component\Console\Attribute\AsCommand;
78

89
#[AsCommand('frosh:env:list')]
9-
class EnvListCommand extends EnvGetCommand
10-
{
11-
}
10+
class EnvListCommand extends EnvGetCommand {}

src/Command/EnvSetCommand.php

Lines changed: 3 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 Frosh\Tools\Command;
@@ -16,7 +17,8 @@
1617
class EnvSetCommand extends Command
1718
{
1819
public function __construct(
19-
#[Autowire('%kernel.project_dir%/.env')] private readonly string $envPath
20+
#[Autowire('%kernel.project_dir%/.env')]
21+
private readonly string $envPath
2022
) {
2123
parent::__construct();
2224
}

src/Command/MonitorCommand.php

Lines changed: 3 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 Frosh\Tools\Command;
@@ -30,7 +31,8 @@ class MonitorCommand extends Command
3031
private const MONITOR_SALESCHANNEL_ARG = 'sales-channel';
3132

3233
public function __construct(
33-
#[Autowire(service: MailService::class)] private readonly AbstractMailService $mailService,
34+
#[Autowire(service: MailService::class)]
35+
private readonly AbstractMailService $mailService,
3436
private readonly SystemConfigService $configService,
3537
private readonly Connection $connection,
3638
private readonly EntityRepository $scheduledTaskRepository

src/Command/UpdateComposerPluginsCommand.php

Lines changed: 3 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 Frosh\Tools\Command;
@@ -20,7 +21,8 @@ class UpdateComposerPluginsCommand extends Command
2021
private readonly Application $application;
2122

2223
public function __construct(
23-
#[Autowire('%kernel.project_dir%')] private readonly string $projectDir,
24+
#[Autowire('%kernel.project_dir%')]
25+
private readonly string $projectDir,
2426
private readonly KernelPluginLoader $pluginLoader
2527
) {
2628
parent::__construct();

0 commit comments

Comments
 (0)