Skip to content

Commit 346e033

Browse files
fix: rector
1 parent d4ca93d commit 346e033

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

src/Command/MonitorCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Frosh\Tools\Command;
55

6+
use Shopware\Core\Content\Mail\Service\MailService;
67
use Doctrine\DBAL\Connection;
78
use Shopware\Core\Content\Mail\Service\AbstractMailService;
89
use Shopware\Core\Framework\Context;
@@ -29,7 +30,7 @@ class MonitorCommand extends Command
2930
private const MONITOR_SALESCHANNEL_ARG = 'sales-channel';
3031

3132
public function __construct(
32-
#[Autowire(service: 'Shopware\Core\Content\Mail\Service\MailService')] private readonly AbstractMailService $mailService,
33+
#[Autowire(service: MailService::class)] private readonly AbstractMailService $mailService,
3334
private readonly SystemConfigService $configService,
3435
private readonly Connection $connection,
3536
private readonly EntityRepository $scheduledTaskRepository

src/Components/Environment/EnvironmentFile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __toString(): string
2525

2626
public function has(string $key): bool
2727
{
28-
return $this->get($key) !== null;
28+
return $this->get($key) instanceof EnvironmentKeyValue;
2929
}
3030

3131
public function get(string $key): ?EnvironmentKeyValue
@@ -43,7 +43,7 @@ public function set(string $key, string $value): void
4343
{
4444
$v = $this->get($key);
4545

46-
if ($v !== null) {
46+
if ($v instanceof EnvironmentKeyValue) {
4747
$v->setValue($value);
4848

4949
return;

src/Components/Health/Checker/HealthChecker/TaskChecker.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ public function collect(HealthCollection $collection): void
4141
$taskDateLimit = (new \DateTimeImmutable())->modify(\sprintf('-%d minutes', $maxDiff));
4242
$recommended = \sprintf('max %d mins', $maxDiff);
4343

44-
$tasks = array_filter($tasks, function (array $task) use ($taskDateLimit) {
45-
return new \DateTimeImmutable($task['next_execution_time']) < $taskDateLimit;
46-
});
44+
$tasks = array_filter($tasks, fn(array $task) => new \DateTimeImmutable($task['next_execution_time']) < $taskDateLimit);
4745

4846
if ($tasks === []) {
4947
$collection->add(SettingsResult::ok('scheduled_task', 'Scheduled tasks', '0 mins', $recommended));

src/Components/StateMachines/Plantuml.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class Plantuml implements ExportInterface
1111
{
1212
private const DEFAULT_PATH = __DIR__ . '/../../Resources/views/administration/plantuml';
1313

14-
private Environment $twig;
14+
private readonly Environment $twig;
1515

1616
public function __construct()
1717
{

src/Controller/StateMachineController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#[Route(path: '/api/_action/frosh-tools', defaults: ['_routeScope' => ['api'], '_acl' => ['frosh_tools:read']])]
1818
final class StateMachineController extends AbstractController
1919
{
20-
public function __construct(private EntityRepository $stateMachineRepository)
20+
public function __construct(private readonly EntityRepository $stateMachineRepository)
2121
{
2222
}
2323

0 commit comments

Comments
 (0)