Skip to content

Commit 0868ccd

Browse files
committed
Fix: cs
1 parent d8472dc commit 0868ccd

File tree

7 files changed

+14
-24
lines changed

7 files changed

+14
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ jobs:
7575
- name: Running PHPMD
7676
run: vendor/bin/phpmd src/ text config/PHPMD/rules.xml;
7777
- name: Running PHP_CodeSniffer
78-
run: vendor/bin/phpcs --standard=config/PhpCodeSniffer/ bin/ src/ tests/ public/;
78+
run: vendor/bin/phpcs --standard=config/PhpCodeSniffer/ --ignore=*/Migrations/* bin/ src/ tests/ public/;

config/PHPMD/rules.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
PHPMD rules for phpList
55
</description>
66

7+
<exclude-pattern>*/Migrations/*</exclude-pattern>
8+
79
<!-- rules from the "clean code" rule set -->
810
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/>
911
<rule ref="rulesets/cleancode.xml/StaticAccess">
@@ -71,5 +73,4 @@
7173
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
7274
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
7375
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
74-
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>
7576
</ruleset>

src/Core/Doctrine/OnlyOrmTablesFilter.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ class OnlyOrmTablesFilter
1616
/** @var string[]|null */
1717
private ?array $allowPrefixes = null;
1818

19-
public function __construct(private readonly EntityManagerInterface $entityManager) {}
19+
public function __construct(private readonly EntityManagerInterface $entityManager)
20+
{
21+
}
2022

2123
public function __invoke(string|AbstractAsset $asset): bool
2224
{
2325
$name = \is_string($asset) ? $asset : $asset->getName();
24-
25-
if (false !== ($pos = strrpos($name, '.'))) {
26+
$pos = strrpos($name, '.');
27+
if (false !== $pos) {
2628
$name = substr($name, $pos + 1);
2729
}
2830
$nameLower = strtolower($name);
@@ -56,12 +58,13 @@ private function buildAllowOnce(): array
5658
}
5759

5860
$tables = [];
59-
foreach ($this->entityManager->getMetadataFactory()->getAllMetadata() as $m) {
60-
if ($t = $m->getTableName()) {
61-
$tables[] = strtolower($t);
61+
foreach ($this->entityManager->getMetadataFactory()->getAllMetadata() as $metadatum) {
62+
$tableName = $metadatum->getTableName();
63+
if ($tableName) {
64+
$tables[] = strtolower($tableName);
6265
}
6366
// many-to-many join tables
64-
foreach ($m->getAssociationMappings() as $assoc) {
67+
foreach ($metadatum->getAssociationMappings() as $assoc) {
6568
if (!empty($assoc['joinTable']['name'])) {
6669
$tables[] = strtolower($assoc['joinTable']['name']);
6770
}
@@ -71,7 +74,7 @@ private function buildAllowOnce(): array
7174
$tables[] = 'doctrine_migration_versions';
7275

7376
$tables = array_values(array_unique($tables));
74-
$prefixes = array_map(static fn($t) => $t . '_', $tables);
77+
$prefixes = array_map(static fn($table) => $table . '_', $tables);
7578

7679
$this->allow = $tables;
7780
$this->allowPrefixes = $prefixes;

src/Domain/Identity/Command/CleanUpOldSessionTokens.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ public function __construct(AdministratorTokenRepository $tokenRepository, Entit
2828
$this->entityManager = $entityManager;
2929
}
3030

31-
/**
32-
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
33-
*/
3431
protected function execute(InputInterface $input, OutputInterface $output): int
3532
{
3633
try {

src/Domain/Messaging/Command/ProcessQueueCommand.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ public function __construct(
5757
$this->entityManager = $entityManager;
5858
}
5959

60-
/**
61-
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
62-
*/
6360
protected function execute(InputInterface $input, OutputInterface $output): int
6461
{
6562
$lock = $this->lockFactory->createLock('queue_processor');

src/Migrations/Version20251028092901MySql.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ public function getDescription(): string
1818
return 'Initial schema from SQL file generated from phplist3';
1919
}
2020

21-
/**
22-
* @SuppressWarnings(PHPMD.ShortMethodName)
23-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
24-
*/
2521
public function up(Schema $schema): void
2622
{
2723
$platform = $this->connection->getDatabasePlatform();

src/Routing/ExtraLoader.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public function __construct(ApplicationStructure $applicationStructure)
4343
/**
4444
* Loads a resource.
4545
*
46-
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
47-
*
4846
* @param mixed $resource the resource (unused)
4947
* @param string|null $type the resource type or null if unknown (unused)
5048
*
@@ -69,8 +67,6 @@ public function load($resource, string $type = null): RouteCollection
6967
/**
7068
* Checks whether this class supports the given resource.
7169
*
72-
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
73-
*
7470
* @param mixed $resource a resource (unused)
7571
* @param string|null $type The resource type or null if unknown
7672
*

0 commit comments

Comments
 (0)