Skip to content

Commit

Permalink
Fix issues found by the PhpStorm code inspector (see #1211)
Browse files Browse the repository at this point in the history
Description
-----------

-

Commits
-------

944fc29 Fix issues found by the PhpStorm code inspector
  • Loading branch information
leofeyer committed Jan 17, 2020
1 parent c93ada8 commit 43bb48e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions core-bundle/src/Controller/InitializeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ private function handleException(\Throwable $e, Request $request, $type): void

try {
$event = new ResponseEvent($this->get('http_kernel'), $request, $type, $response);
$this->get('event_dispatcher')->dispatch(KernelEvents::RESPONSE, $event);
$this->get('event_dispatcher')->dispatch($event, KernelEvents::RESPONSE);
$response = $event->getResponse();

$this->get('event_dispatcher')->dispatch(
KernelEvents::FINISH_REQUEST,
new FinishRequestEvent($this->get('http_kernel'), $request, $type)
new FinishRequestEvent($this->get('http_kernel'), $request, $type),
KernelEvents::FINISH_REQUEST
);

$this->get('request_stack')->pop();
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Exception/ServiceUnavailableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Contao\CoreBundle\Exception;

@trigger_error('Using the "ServiceUnavailableException" class has been deprecated and will no longer work in Contao 5.0. Use the "Lexik\Bundle\MaintenanceBundle\Exception\ServiceUnavailableException" class instead.', E_USER_DEPRECATED);
@trigger_error('Using the "Contao\CoreBundle\Exception\ServiceUnavailableException" class has been deprecated and will no longer work in Contao 5.0. Use the "Lexik\Bundle\MaintenanceBundle\Exception\ServiceUnavailableException" class instead.', E_USER_DEPRECATED);

/**
* @deprecated Deprecated since Contao 4.1, to be removed in Contao 5.0; use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public function testUsesTheJsonManifestVersionStrategyForBundles(): void
$this->assertSame('assets._version_manifest_json', (string) $service->getArgument(1));
$this->assertTrue($container->hasDefinition('assets._version_manifest_json'));

/** @var ChildDefinition $definition */
$definition = $container->getDefinition('assets._version_manifest_json');

$this->assertInstanceOf(ChildDefinition::class, $definition);
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/tests/Migration/MigrationCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testGetPendingNames(): void
$migrations = new MigrationCollection($this->getMigrationServices());
$pendingMigrations = $migrations->getPendingNames();

if (!\is_array($pendingMigrations)) {
if ($pendingMigrations instanceof \Traversable) {
$pendingMigrations = iterator_to_array($pendingMigrations);
}

Expand All @@ -36,7 +36,7 @@ public function testRunMigrations(): void
$migrations = new MigrationCollection($this->getMigrationServices());
$results = $migrations->run();

if (!\is_array($results)) {
if ($results instanceof \Traversable) {
$results = iterator_to_array($results);
}

Expand Down
3 changes: 1 addition & 2 deletions installation-bundle/src/Database/AbstractVersionUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@

namespace Contao\InstallationBundle\Database;

use Contao\CoreBundle\Migration\AbstractMigration;
use Doctrine\DBAL\Connection;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

@trigger_error(sprintf('Using the "%s" class has been deprecated and will no longer work in Contao 5.0. Use the "%s" class instead.', AbstractVersionUpdate::class, AbstractMigration::class), E_USER_DEPRECATED);
@trigger_error('Using the "Contao\InstallationBundle\Database\AbstractVersionUpdate" class has been deprecated and will no longer work in Contao 5.0. Use the "Contao\CoreBundle\Migration\AbstractMigration" class instead.', E_USER_DEPRECATED);

/**
* @deprecated Deprecated since Contao 4.9, to be removed in Contao 5.0; use the
Expand Down

0 comments on commit 43bb48e

Please sign in to comment.