Skip to content

Commit 64af99b

Browse files
authored
Updated checkstyle library and embrace PER 2.0 (#159)
1 parent 05714fc commit 64af99b

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

src/ContainerParameterAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function get(JobExecution $execution): mixed
2828
} catch (InvalidArgumentException $exception) {
2929
throw new CannotAccessParameterException(
3030
\sprintf('Cannot access "%s" parameter from container parameters', $this->name),
31-
$exception
31+
$exception,
3232
);
3333
}
3434
}

src/DependencyInjection/YokaiBatchExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private function getLoader(ContainerBuilder $container): LoaderInterface
8888
[
8989
new DependencyInjectionLoader\XmlFileLoader($container, $locator),
9090
new DependencyInjectionLoader\DirectoryLoader($container, $locator),
91-
]
91+
],
9292
);
9393

9494
return new ConfigLoader\DelegatingLoader($resolver);
@@ -111,7 +111,7 @@ private function configureStorage(ContainerBuilder $container, array $config): v
111111
'connection' => $config['dbal']['connection'],
112112
'table' => $config['dbal']['table'],
113113
],
114-
]
114+
],
115115
)
116116
;
117117

src/UserInterface/Controller/JobController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class JobController
3131

3232
public function __construct(
3333
private QueryableJobExecutionStorageInterface $jobExecutionStorage,
34-
private ?FormFactoryInterface $formFactory,
34+
private null|FormFactoryInterface $formFactory,
3535
private JobSecurity $security,
3636
private Environment $twig,
3737
private TemplatingInterface $templating,
@@ -60,7 +60,7 @@ public function list(Request $request): Response
6060
[
6161
'method' => Request::METHOD_GET,
6262
'csrf_protection' => false,
63-
]
63+
],
6464
);
6565
$filter->handleRequest($request);
6666

@@ -136,7 +136,7 @@ public function list(Request $request): Response
136136
/**
137137
* View {@see JobExecution} details in a Twig template.
138138
*/
139-
public function view(string $job, string $id, ?string $path = null): Response
139+
public function view(string $job, string $id, null|string $path = null): Response
140140
{
141141
try {
142142
$execution = $this->jobExecutionStorage->retrieve($job, $id);
@@ -192,7 +192,7 @@ public function logs(string $job, string $id): Response
192192
$response = new Response((string)$execution->getLogs());
193193
$response->headers->set(
194194
'Content-Disposition',
195-
$response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $filename)
195+
$response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $filename),
196196
);
197197
$response->headers->set('Content-Type', 'application/log');
198198

src/UserInterface/JobSecurity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
final class JobSecurity
1616
{
1717
public function __construct(
18-
private ?AuthorizationCheckerInterface $authorizationChecker,
18+
private null|AuthorizationCheckerInterface $authorizationChecker,
1919
private string $listAttribute,
2020
private string $viewAttribute,
2121
private string $tracesAttribute,

tests/DependencyInjection/CompilerPass/ConfigureLauncherPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testNominal(): void
2626
public function testMissingService(): void
2727
{
2828
$this->expectExceptionObject(
29-
new LogicException('Job launcher service "app.yokai_batch_job_launcher" does not exists.')
29+
new LogicException('Job launcher service "app.yokai_batch_job_launcher" does not exists.'),
3030
);
3131
$this->process(function (ContainerBuilder $container) {
3232
$container->setAlias(JobLauncherInterface::class, 'app.yokai_batch_job_launcher');

tests/DependencyInjection/CompilerPass/ConfigureTemplatingPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testNominal(): void
2626
public function testMissingService(): void
2727
{
2828
$this->expectExceptionObject(
29-
new LogicException('UI templating service "app.yokai_batch_templating" does not exists.')
29+
new LogicException('UI templating service "app.yokai_batch_templating" does not exists.'),
3030
);
3131
$this->process(function (ContainerBuilder $container) {
3232
$container->setAlias(TemplatingInterface::class, 'app.yokai_batch_templating');

tests/DependencyInjection/YokaiBatchExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,13 @@ public function errors(): \Generator
371371
yield 'Per job parameters value must be an array' => [
372372
['parameters' => ['per_job' => ['job.foo' => 'string']]],
373373
new InvalidConfigurationException(
374-
'Invalid configuration for path "yokai_batch.parameters.per_job.job.foo": Should be an array<string, mixed>.'
374+
'Invalid configuration for path "yokai_batch.parameters.per_job.job.foo": Should be an array<string, mixed>.',
375375
),
376376
];
377377
yield 'Per job parameters value must be a string indexed array' => [
378378
['parameters' => ['per_job' => ['job.foo' => [1, 2, 3]]]],
379379
new InvalidConfigurationException(
380-
'Invalid configuration for path "yokai_batch.parameters.per_job.job.foo": Should be an array<string, mixed>.'
380+
'Invalid configuration for path "yokai_batch.parameters.per_job.job.foo": Should be an array<string, mixed>.',
381381
),
382382
];
383383
}

tests/UserInterface/Controller/JobControllerTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function setUp(): void
7272
public function testList(
7373
\Closure $fixtures,
7474
Request $request,
75-
?FormFactoryInterface $formFactory,
75+
null|FormFactoryInterface $formFactory,
7676
JobSecurity $security,
7777
TemplatingInterface $templating,
7878
int $expectedStatus,
@@ -197,7 +197,7 @@ public function testView(
197197
\Closure $fixtures,
198198
string $job,
199199
string $id,
200-
?string $path,
200+
null|string $path,
201201
JobSecurity $security,
202202
TemplatingInterface $templating,
203203
int $expectedStatus,
@@ -235,7 +235,7 @@ public static function view(): \Generator
235235
new Summary(['count' => 156]),
236236
);
237237
$exportExecution->addWarning(
238-
new Warning('Skipped suspicious record', [], ['suspicious_record' => 2])
238+
new Warning('Skipped suspicious record', [], ['suspicious_record' => 2]),
239239
);
240240
$exportExecution->addFailure(new Failure('RuntimeException', 'Missing record #2', 0));
241241
$exportExecution->setStartTime(new \DateTimeImmutable('2021-01-01 10:00'));
@@ -447,7 +447,7 @@ private static function templatings(): \Generator
447447
*/
448448
private function response(
449449
\Closure $closure,
450-
?FormFactoryInterface $formFactory,
450+
null|FormFactoryInterface $formFactory,
451451
JobSecurity $security,
452452
TemplatingInterface $templating,
453453
): Response {
@@ -461,7 +461,7 @@ private function response(
461461
}
462462

463463
private function controller(
464-
?FormFactoryInterface $formFactory,
464+
null|FormFactoryInterface $formFactory,
465465
JobSecurity $security,
466466
TemplatingInterface $templating,
467467
): JobController {
@@ -519,7 +519,7 @@ private static function fixtures(int $count, array $attributes = []): void
519519
])),
520520
'startTime' => $start = (new \DateTimeImmutable())->setTimestamp(\random_int(0, \time() - 10)),
521521
'endTime' => (new \DateTimeImmutable())->setTimestamp(
522-
\random_int($start->getTimestamp(), \time() - 10)
522+
\random_int($start->getTimestamp(), \time() - 10),
523523
),
524524
],
525525
$attributes,
@@ -545,7 +545,7 @@ private static function assertSelectorTextContains(Crawler $crawler, string $sel
545545
{
546546
self::assertThat($crawler, LogicalAnd::fromConstraints(
547547
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
548-
new DomCrawlerConstraint\CrawlerSelectorTextContains($selector, $text)
548+
new DomCrawlerConstraint\CrawlerSelectorTextContains($selector, $text),
549549
));
550550
}
551551

0 commit comments

Comments
 (0)