Skip to content

Commit 1fb0b96

Browse files
committed
More fixes
1 parent d6b22e4 commit 1fb0b96

File tree

23 files changed

+43
-75
lines changed

23 files changed

+43
-75
lines changed

core-bundle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ framework:
5858
```
5959
6060
Add the Contao routes to your `config/routing.yaml` file, and be sure to load
61-
the `ContaoCoreBundle` at the very end, so the catch all route does not catch
61+
the `ContaoCoreBundle` at the very end, so the catch-all route does not catch
6262
your application routes.
6363

6464
```yml

core-bundle/src/Command/InstallCommand.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ class InstallCommand extends Command
3333
*/
3434
private $fs;
3535

36-
/**
37-
* @var SymfonyStyle
38-
*/
39-
private $io;
40-
4136
/**
4237
* @var array
4338
*/
@@ -83,14 +78,14 @@ protected function configure(): void
8378
protected function execute(InputInterface $input, OutputInterface $output): int
8479
{
8580
$this->fs = new Filesystem();
86-
$this->io = new SymfonyStyle($input, $output);
8781
$this->webDir = rtrim($input->getArgument('target'), '/');
8882

8983
$this->addEmptyDirs();
9084

9185
if (!empty($this->rows)) {
92-
$this->io->newLine();
93-
$this->io->listing($this->rows);
86+
$io = new SymfonyStyle($input, $output);
87+
$io->newLine();
88+
$io->listing($this->rows);
9489
}
9590

9691
return 0;

core-bundle/src/Command/ResizeImagesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private function resizeImage(string $path, bool $quiet = false): int
191191
return 0;
192192
}
193193

194-
private function resizeImages(float $timeLimit, float $concurrent, bool $noSubProcess)
194+
private function resizeImages(float $timeLimit, float $concurrent, bool $noSubProcess): int
195195
{
196196
if (!$noSubProcess && $this->supportsSubProcesses()) {
197197
return $this->executeConcurrent($timeLimit, $concurrent);

core-bundle/src/Command/SymlinksCommand.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ class SymlinksCommand extends Command
3636
{
3737
protected static $defaultName = 'contao:symlinks';
3838

39-
/**
40-
* @var SymfonyStyle
41-
*/
42-
private $io;
43-
4439
/**
4540
* @var array
4641
*/
@@ -102,14 +97,14 @@ protected function configure(): void
10297

10398
protected function execute(InputInterface $input, OutputInterface $output): int
10499
{
105-
$this->io = new SymfonyStyle($input, $output);
106100
$this->webDir = rtrim($input->getArgument('target'), '/');
107101

108102
$this->generateSymlinks();
109103

110104
if (!empty($this->rows)) {
111-
$this->io->newLine();
112-
$this->io->table(['', 'Symlink', 'Target / Error'], $this->rows);
105+
$io = new SymfonyStyle($input, $output);
106+
$io->newLine();
107+
$io->table(['', 'Symlink', 'Target / Error'], $this->rows);
113108
}
114109

115110
return $this->statusCode;

core-bundle/src/Routing/Matcher/UrlMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct()
2929
parent::__construct(new RouteCollection(), new RequestContext());
3030
}
3131

32-
public function finalMatch(RouteCollection $collection, Request $request)
32+
public function finalMatch(RouteCollection $collection, Request $request): array
3333
{
3434
$this->routes = $collection;
3535

core-bundle/tests/Contao/Database/ResultTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testSingleRow(): void
9393
$this->assertSame(['field' => 'new value'], $result->row());
9494
$this->assertSame(['new value'], $result->row(true));
9595
$this->assertSame('value1', $result->fetchField());
96-
$this->assertSame('value1', $result->fetchField(0));
96+
$this->assertSame('value1', $result->fetchField());
9797
}
9898

9999
$this->expectException(PHP_MAJOR_VERSION < 8 ? Notice::class : Warning::class);
@@ -141,7 +141,7 @@ public function testMultipleRows(): void
141141
$this->assertSame(['field' => 'new value'], $result->row());
142142
$this->assertSame(['new value'], $result->row(true));
143143
$this->assertSame('value2', $result->fetchField());
144-
$this->assertSame('value2', $result->fetchField(0));
144+
$this->assertSame('value2', $result->fetchField());
145145
}
146146

147147
$this->expectException(PHP_MAJOR_VERSION < 8 ? Notice::class : Warning::class);

core-bundle/tests/Contao/GdImageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function testRecognizesSemitransparentImages(): void
266266

267267
private function assertIsGdResource($resource): void
268268
{
269-
if (\is_object($resource)) {
269+
if (PHP_MAJOR_VERSION >= 8) {
270270
// PHP >= 8.0
271271
$this->assertInstanceOf(\GdImage::class, $resource);
272272
} else {

core-bundle/tests/Contao/SearchTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ public function testCompareUrls($moreCanonicalUrl, $lessCanonicalUrl): void
4242
$this->assertSame(0, $compareUrls->invokeArgs(null, [$lessCanonicalUrl, $lessCanonicalUrl]));
4343
}
4444

45-
/**
46-
* Provides the data for the testCompareUrls() method.
47-
*
48-
* @return array
49-
*/
50-
public function compareUrlsProvider()
45+
public function compareUrlsProvider(): array
5146
{
5247
return [
5348
['foo/bar.html', 'foo/bar.html?query'],

core-bundle/tests/EventListener/PreviewToolbarListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function testDoesNotInjectTheToolbarOnContentDispositionAttachment(): voi
143143

144144
$event = new ResponseEvent(
145145
$this->createMock(HttpKernelInterface::class),
146-
$this->getRequestMock(false, 'html'),
146+
$this->getRequestMock(),
147147
HttpKernelInterface::MASTER_REQUEST,
148148
$response
149149
);

core-bundle/tests/EventListener/SearchIndexListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,31 +91,31 @@ public function getRequestResponse(): \Generator
9191
];
9292

9393
yield 'Should be ignored because the response was not successful (404) but there was no ld+json data' => [
94-
Request::create('/foobar', 'GET'),
94+
Request::create('/foobar'),
9595
new Response('', 404),
9696
SearchIndexListener::FEATURE_DELETE | SearchIndexListener::FEATURE_INDEX,
9797
false,
9898
false,
9999
];
100100

101101
yield 'Should be deleted because the response was not successful (404)' => [
102-
Request::create('/foobar', 'GET'),
102+
Request::create('/foobar'),
103103
new Response('<html><body><script type="application/ld+json">{"@context":"https:\/\/contao.org\/","@type":"Page","pageId":2,"noSearch":false,"protected":false,"groups":[],"fePreview":false}</script></body></html>', 404),
104104
SearchIndexListener::FEATURE_DELETE | SearchIndexListener::FEATURE_INDEX,
105105
false,
106106
true,
107107
];
108108

109109
yield 'Should be deleted because the response was not successful (403)' => [
110-
Request::create('/foobar', 'GET'),
110+
Request::create('/foobar'),
111111
new Response('<html><body><script type="application/ld+json">{"@context":"https:\/\/contao.org\/","@type":"Page","pageId":2,"noSearch":false,"protected":false,"groups":[],"fePreview":false}</script></body></html>', 403),
112112
SearchIndexListener::FEATURE_DELETE | SearchIndexListener::FEATURE_INDEX,
113113
false,
114114
true,
115115
];
116116

117117
yield 'Should not be deleted because even though the response was not successful (403), it was disabled by the feature flag ' => [
118-
Request::create('/foobar', 'GET'),
118+
Request::create('/foobar'),
119119
new Response('<html><body><script type="application/ld+json">{"@context":"https:\/\/contao.org\/","@type":"Page","pageId":2,"noSearch":false,"protected":false,"groups":[],"fePreview":false}</script></body></html>', 403),
120120
SearchIndexListener::FEATURE_INDEX,
121121
false,

0 commit comments

Comments
 (0)