Skip to content

Commit

Permalink
Clean up after the upstream merge
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Dec 11, 2020
1 parent 5eb206f commit 950581e
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 27 deletions.
Expand Up @@ -195,7 +195,7 @@ public function renderArticlePasteButton(DataContainer $dc, array $row, string $
return $this->renderArticlePasteAfterButton($dc, $row, $cr, $clipboard);
}

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

private function renderArticlePasteAfterButton(DataContainer $dc, array $row, bool $cr, array $clipboard = null)
private function renderArticlePasteAfterButton(DataContainer $dc, array $row, bool $cr, array $clipboard = null): string
{
/** @var PageModel $pageAdapter */
$pageAdapter = $this->framework->getAdapter(PageModel::class);
Expand Down
Expand Up @@ -47,7 +47,7 @@ public function __construct(PageRegistry $pageRegistry, Security $security, Even
$this->eventDispatcher = $eventDispatcher;
}

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

Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/library/Contao/Search.php
Expand Up @@ -349,7 +349,7 @@ public static function indexPage($arrData)
tl_search_index.pid,
SQRT(SUM(POW(
(1 + LOG(relevance)) * LOG((
" . (int) ($objDatabase->query("SELECT COUNT(*) as count FROM tl_search")->count + 1) . "
" . ($objDatabase->query("SELECT COUNT(*) as count FROM tl_search")->count + 1) . "
) / GREATEST(1, documentFrequency)),
2
))) as vectorLength
Expand Down
1 change: 0 additions & 1 deletion core-bundle/src/Routing/Page/PageRegistry.php
Expand Up @@ -95,7 +95,6 @@ public function getPathRegex(): array
{
$prefixes = [];

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

Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/ServiceAnnotation/Page.php
Expand Up @@ -91,7 +91,7 @@ public function __construct(array $data)
$method = 'set'.str_replace('_', '', $key);

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

$this->$method($value);
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Util/SimpleTokenParser.php
Expand Up @@ -254,7 +254,7 @@ private function getVariables(string $expression): array

$variables = [];

for ($i = 0; $i < \count($tokens); ++$i) {
for ($i = 0, $c = \count($tokens); $i < $c; ++$i) {
if (!$tokens[$i]->test(Token::NAME_TYPE)) {
continue;
}
Expand Down
2 changes: 2 additions & 0 deletions core-bundle/tests/Command/MigrateCommandTest.php
Expand Up @@ -18,6 +18,7 @@
use Contao\CoreBundle\Migration\MigrationResult;
use Contao\CoreBundle\Tests\TestCase;
use Contao\InstallationBundle\Database\Installer;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Filesystem\Filesystem;
Expand Down Expand Up @@ -176,6 +177,7 @@ public function testDoesNotAbortIfMigrationFails(): void
* @param array<array<string>> $pendingMigrations
* @param array<array<MigrationResult>> $migrationResults
* @param array<array<string>> $runonceFiles
* @param Installer&MockObject $installer
*/
private function getCommand(array $pendingMigrations = [], array $migrationResults = [], array $runonceFiles = [], Installer $installer = null): MigrateCommand
{
Expand Down
6 changes: 6 additions & 0 deletions core-bundle/tests/Command/ResizeImagesCommandTest.php
Expand Up @@ -19,6 +19,7 @@
use Contao\Image\DeferredImageStorageInterface;
use Contao\Image\DeferredResizerInterface;
use Contao\Image\ImageInterface;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Bridge\PhpUnit\ClockMock;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Filesystem\Filesystem;
Expand Down Expand Up @@ -132,6 +133,11 @@ function () {
$this->assertNotRegExp('/image2.jpg/', $display);
}

/**
* @param ImageFactoryInterface&MockObject $factory
* @param DeferredResizerInterface&MockObject $resizer
* @param DeferredImageStorageInterface&MockObject $storage
*/
private function getCommand(ImageFactoryInterface $factory = null, DeferredResizerInterface $resizer = null, DeferredImageStorageInterface $storage = null): ResizeImagesCommand
{
return new ResizeImagesCommand(
Expand Down
Expand Up @@ -135,10 +135,7 @@ public function testRemovesErrorTypesAlreadyPresentInTheRootPage(): void
private function mockDataContainer(?int $pid, int $id = null): DataContainer
{
$activeRecord = array_filter(
[
'id' => $id,
'pid' => $pid,
],
compact('id', 'pid'),
static function ($v): bool {
return null !== $v;
}
Expand Down
3 changes: 3 additions & 0 deletions core-bundle/tests/Framework/ContaoFrameworkTest.php
Expand Up @@ -693,6 +693,9 @@ public function testDelegatesTheResetCalls(): void
$this->assertCount(0, $registry);
}

/**
* @param TokenChecker&MockObject $tokenChecker
*/
private function mockFramework(Request $request = null, ScopeMatcher $scopeMatcher = null, TokenChecker $tokenChecker = null): ContaoFramework
{
$requestStack = new RequestStack();
Expand Down
9 changes: 0 additions & 9 deletions core-bundle/tests/Functional/RoutingTest.php
Expand Up @@ -15,7 +15,6 @@
use Contao\Config;
use Contao\System;
use Contao\TestCase\FunctionalTestCase;
use Symfony\Component\HttpFoundation\Response;

class RoutingTest extends FunctionalTestCase
{
Expand Down Expand Up @@ -62,8 +61,6 @@ public function testResolvesAliases(array $fixtures, string $request, int $statu

$crawler = $client->request('GET', "http://$host$request");
$title = trim($crawler->filterXPath('//head/title')->text());

/** @var Response $response */
$response = $client->getResponse();

$this->assertSame($statusCode, $response->getStatusCode());
Expand Down Expand Up @@ -384,8 +381,6 @@ public function testResolvesAliasesWithLocale(array $fixtures, string $request,

$crawler = $client->request('GET', "http://$host$request");
$title = trim($crawler->filterXPath('//head/title')->text());

/** @var Response $response */
$response = $client->getResponse();

$this->assertSame($statusCode, $response->getStatusCode());
Expand Down Expand Up @@ -712,8 +707,6 @@ public function testResolvesAliasesWithoutUrlSuffix(array $fixtures, string $req

$crawler = $client->request('GET', "http://$host$request");
$title = trim($crawler->filterXPath('//head/title')->text());

/** @var Response $response */
$response = $client->getResponse();

$this->assertSame($statusCode, $response->getStatusCode());
Expand Down Expand Up @@ -1061,8 +1054,6 @@ public function testResolvesTheRootPageWithLocale(array $fixtures, string $reque

$crawler = $client->request('GET', "http://$host$request");
$title = trim($crawler->filterXPath('//head/title')->text());

/** @var Response $response */
$response = $client->getResponse();

$this->assertSame($statusCode, $response->getStatusCode());
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/tests/Image/Studio/FigureBuilderTest.php
Expand Up @@ -45,7 +45,7 @@ public function testFromFilesModel(): void

$studio = $this->getStudioMockForImage($absoluteFilePath);

$this->getFigureBuilder($studio, null)->fromFilesModel($model)->build();
$this->getFigureBuilder($studio)->fromFilesModel($model)->build();
}

public function testFromFilesModelFailsWithInvalidDBAFSType(): void
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/tests/Image/Studio/ImageResultTest.php
Expand Up @@ -269,7 +269,7 @@ public function testGetFilePathFromPathResource(): void
$projectDir = 'project/dir';
$filePath = 'project/dir/file/path';

$locator = $this->getLocatorMock(null);
$locator = $this->getLocatorMock();
$imageResult = new ImageResult($locator, $projectDir, $filePath);

$this->assertSame('file/path', $imageResult->getFilePath());
Expand Down
8 changes: 4 additions & 4 deletions core-bundle/tests/Routing/RouteProviderTest.php
Expand Up @@ -498,8 +498,8 @@ public function testSortsTheRootRoutes(array $pages, array $languages, array $ex
public function getRootRoutes(): \Generator
{
$pages = [
2 => $this->createRootPage('en', 'english-root', true),
1 => $this->createPage('en', 'index', true),
2 => $this->createRootPage('en', 'english-root'),
1 => $this->createPage('en', 'index'),
0 => $this->createRootPage('de', 'german-root', false),
];

Expand All @@ -516,8 +516,8 @@ public function getRootRoutes(): \Generator
];

$pages = [
2 => $this->createRootPage('en', 'english-root', true),
1 => $this->createPage('en', 'index', true),
2 => $this->createRootPage('en', 'english-root'),
1 => $this->createPage('en', 'index'),
0 => $this->createRootPage('de', 'german-root', false),
];

Expand Down
Expand Up @@ -19,7 +19,7 @@

class ContaoNewsletterExtension extends Extension
{
public function load(array $mergedConfig, ContainerBuilder $container): void
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader(
$container,
Expand Down

0 comments on commit 950581e

Please sign in to comment.