Skip to content

Commit

Permalink
Fix the coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jul 17, 2020
1 parent 444c736 commit 6ef2654
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/library/Contao/Template.php
Expand Up @@ -340,7 +340,7 @@ public function getResponse()
*/
public function route($strName, $arrParams=array())
{
if (!is_string($strName))
if (!\is_string($strName))
{
$arrParams[PageRoute::CONTENT_PARAMETER] = $strName;
$strName = PageRoute::ROUTE_NAME;
Expand All @@ -362,7 +362,7 @@ public function route($strName, $arrParams=array())
*/
public function previewRoute($strName, $arrParams=array())
{
if (!is_string($strName))
if (!\is_string($strName))
{
$arrParams[PageRoute::CONTENT_PARAMETER] = $strName;
$strName = PageRoute::ROUTE_NAME;
Expand Down
1 change: 0 additions & 1 deletion core-bundle/src/Routing/Route404Provider.php
Expand Up @@ -165,7 +165,6 @@ private function getLocaleFallbackRoutes(Request $request = null): array
if (null === $request) {
/** @var PageModel $pageAdapter */
$pageAdapter = $this->framework->getAdapter(PageModel::class);

$pages = $pageAdapter->findAll();
} else {
$pages = $this->findCandidatePages($request);
Expand Down
17 changes: 10 additions & 7 deletions core-bundle/tests/Event/FilterPageTypeEventTest.php
@@ -1,5 +1,15 @@
<?php

declare(strict_types=1);

/*
* This file is part of Contao.
*
* (c) Leo Feyer
*
* @license LGPL-3.0-or-later
*/

namespace Contao\CoreBundle\Tests\Event;

use Contao\CoreBundle\Event\FilterPageTypeEvent;
Expand All @@ -11,7 +21,6 @@ class FilterPageTypeEventTest extends TestCase
public function testReturnsDataContainer(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent([], $dc);

$this->assertSame($dc, $event->getDataContainer());
Expand All @@ -20,7 +29,6 @@ public function testReturnsDataContainer(): void
public function testReturnsOptionsWithNumericKeys(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent(['foo' => 'bar'], $dc);

$this->assertSame(['bar'], $event->getOptions());
Expand All @@ -29,7 +37,6 @@ public function testReturnsOptionsWithNumericKeys(): void
public function testCanAddOption(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent([], $dc);

$this->assertSame([], $event->getOptions());
Expand All @@ -42,7 +49,6 @@ public function testCanAddOption(): void
public function testDoesNotAddDuplicateOptions(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent(['foo'], $dc);

$this->assertSame(['foo'], $event->getOptions());
Expand All @@ -55,7 +61,6 @@ public function testDoesNotAddDuplicateOptions(): void
public function testCanSetOptions(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent(['foo'], $dc);

$this->assertSame(['foo'], $event->getOptions());
Expand All @@ -68,7 +73,6 @@ public function testCanSetOptions(): void
public function testCanRemoveOption(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent(['foo'], $dc);

$this->assertSame(['foo'], $event->getOptions());
Expand All @@ -81,7 +85,6 @@ public function testCanRemoveOption(): void
public function testIgnoresMissingWhenRemovingOptions(): void
{
$dc = $this->createMock(DataContainer::class);

$event = new FilterPageTypeEvent(['foo'], $dc);

$this->assertSame(['foo'], $event->getOptions());
Expand Down
3 changes: 0 additions & 3 deletions core-bundle/tests/Routing/Route404ProviderTest.php
Expand Up @@ -227,7 +227,6 @@ public function testCreatesOneRouteWithoutLocale(): void

$framework = $this->mockContaoFramework([PageModel::class => $pageAdapter]);
$request = $this->mockRequestWithPath('/');

$candidates = $this->createMock(Candidates::class);

$provider = new Route404Provider(
Expand Down Expand Up @@ -339,7 +338,6 @@ public function testCorrectlySortRoutes(array $expectedRoutes, array $languages,

$framework = $this->mockContaoFramework([PageModel::class => $pageAdapter]);
$request = $this->mockRequestWithPath('/', $languages);

$candidates = $this->createMock(Candidates::class);

$provider = new Route404Provider(
Expand Down Expand Up @@ -415,7 +413,6 @@ public function testIgnoresRoutesWithoutRootId(): void

$framework = $this->mockContaoFramework([PageModel::class => $pageAdapter]);
$request = $this->mockRequestWithPath('/');

$candidates = $this->createMock(Candidates::class);

$provider = new Route404Provider(
Expand Down

0 comments on commit 6ef2654

Please sign in to comment.