Skip to content

Commit 950581e

Browse files
committed
Clean up after the upstream merge
1 parent 5eb206f commit 950581e

File tree

15 files changed

+25
-27
lines changed

15 files changed

+25
-27
lines changed

core-bundle/src/EventListener/DataContainer/ContentCompositionListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function renderArticlePasteButton(DataContainer $dc, array $row, string $
195195
return $this->renderArticlePasteAfterButton($dc, $row, $cr, $clipboard);
196196
}
197197

198-
private function renderArticlePasteIntoButton(DataContainer $dc, array $row, bool $cr, array $clipboard = null)
198+
private function renderArticlePasteIntoButton(DataContainer $dc, array $row, bool $cr, array $clipboard = null): string
199199
{
200200
$pageModel = $this->framework->createInstance(PageModel::class);
201201
$pageModel->preventSaving(false);
@@ -218,7 +218,7 @@ private function renderArticlePasteIntoButton(DataContainer $dc, array $row, boo
218218
);
219219
}
220220

221-
private function renderArticlePasteAfterButton(DataContainer $dc, array $row, bool $cr, array $clipboard = null)
221+
private function renderArticlePasteAfterButton(DataContainer $dc, array $row, bool $cr, array $clipboard = null): string
222222
{
223223
/** @var PageModel $pageAdapter */
224224
$pageAdapter = $this->framework->getAdapter(PageModel::class);

core-bundle/src/EventListener/DataContainer/PageTypeOptionsListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(PageRegistry $pageRegistry, Security $security, Even
4747
$this->eventDispatcher = $eventDispatcher;
4848
}
4949

50-
public function __invoke(DataContainer $dc)
50+
public function __invoke(DataContainer $dc): array
5151
{
5252
$options = array_unique(array_merge(array_keys($GLOBALS['TL_PTY']), $this->pageRegistry->keys()));
5353

core-bundle/src/Resources/contao/library/Contao/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public static function indexPage($arrData)
349349
tl_search_index.pid,
350350
SQRT(SUM(POW(
351351
(1 + LOG(relevance)) * LOG((
352-
" . (int) ($objDatabase->query("SELECT COUNT(*) as count FROM tl_search")->count + 1) . "
352+
" . ($objDatabase->query("SELECT COUNT(*) as count FROM tl_search")->count + 1) . "
353353
) / GREATEST(1, documentFrequency)),
354354
2
355355
))) as vectorLength

core-bundle/src/Routing/Page/PageRegistry.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public function getPathRegex(): array
9595
{
9696
$prefixes = [];
9797

98-
/** @var RouteConfig $config */
9998
foreach ($this->routeConfigs as $type => $config) {
10099
$regex = $config->getPathRegex();
101100

core-bundle/src/ServiceAnnotation/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function __construct(array $data)
9191
$method = 'set'.str_replace('_', '', $key);
9292

9393
if (!method_exists($this, $method)) {
94-
throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, static::class));
94+
throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, self::class));
9595
}
9696

9797
$this->$method($value);

core-bundle/src/Util/SimpleTokenParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private function getVariables(string $expression): array
254254

255255
$variables = [];
256256

257-
for ($i = 0; $i < \count($tokens); ++$i) {
257+
for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
258258
if (!$tokens[$i]->test(Token::NAME_TYPE)) {
259259
continue;
260260
}

core-bundle/tests/Command/MigrateCommandTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Contao\CoreBundle\Migration\MigrationResult;
1919
use Contao\CoreBundle\Tests\TestCase;
2020
use Contao\InstallationBundle\Database\Installer;
21+
use PHPUnit\Framework\MockObject\MockObject;
2122
use Symfony\Component\Config\FileLocator;
2223
use Symfony\Component\Console\Tester\CommandTester;
2324
use Symfony\Component\Filesystem\Filesystem;
@@ -176,6 +177,7 @@ public function testDoesNotAbortIfMigrationFails(): void
176177
* @param array<array<string>> $pendingMigrations
177178
* @param array<array<MigrationResult>> $migrationResults
178179
* @param array<array<string>> $runonceFiles
180+
* @param Installer&MockObject $installer
179181
*/
180182
private function getCommand(array $pendingMigrations = [], array $migrationResults = [], array $runonceFiles = [], Installer $installer = null): MigrateCommand
181183
{

core-bundle/tests/Command/ResizeImagesCommandTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Contao\Image\DeferredImageStorageInterface;
2020
use Contao\Image\DeferredResizerInterface;
2121
use Contao\Image\ImageInterface;
22+
use PHPUnit\Framework\MockObject\MockObject;
2223
use Symfony\Bridge\PhpUnit\ClockMock;
2324
use Symfony\Component\Console\Tester\CommandTester;
2425
use Symfony\Component\Filesystem\Filesystem;
@@ -132,6 +133,11 @@ function () {
132133
$this->assertNotRegExp('/image2.jpg/', $display);
133134
}
134135

136+
/**
137+
* @param ImageFactoryInterface&MockObject $factory
138+
* @param DeferredResizerInterface&MockObject $resizer
139+
* @param DeferredImageStorageInterface&MockObject $storage
140+
*/
135141
private function getCommand(ImageFactoryInterface $factory = null, DeferredResizerInterface $resizer = null, DeferredImageStorageInterface $storage = null): ResizeImagesCommand
136142
{
137143
return new ResizeImagesCommand(

core-bundle/tests/EventListener/FilterPageTypeListenerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ public function testRemovesErrorTypesAlreadyPresentInTheRootPage(): void
135135
private function mockDataContainer(?int $pid, int $id = null): DataContainer
136136
{
137137
$activeRecord = array_filter(
138-
[
139-
'id' => $id,
140-
'pid' => $pid,
141-
],
138+
compact('id', 'pid'),
142139
static function ($v): bool {
143140
return null !== $v;
144141
}

core-bundle/tests/Framework/ContaoFrameworkTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,9 @@ public function testDelegatesTheResetCalls(): void
693693
$this->assertCount(0, $registry);
694694
}
695695

696+
/**
697+
* @param TokenChecker&MockObject $tokenChecker
698+
*/
696699
private function mockFramework(Request $request = null, ScopeMatcher $scopeMatcher = null, TokenChecker $tokenChecker = null): ContaoFramework
697700
{
698701
$requestStack = new RequestStack();

0 commit comments

Comments
 (0)