Skip to content

Commit

Permalink
Applied fixes from FlintCI
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh authored and jordisala1991 committed Oct 11, 2020
1 parent 5847249 commit a08dfb9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Knp\Menu\FactoryInterface as MenuFactoryInterface;
use Knp\Menu\ItemInterface;
use RuntimeException;
use Sonata\AdminBundle\Builder\DatagridBuilderInterface;
use Sonata\AdminBundle\Builder\FormContractorInterface;
use Sonata\AdminBundle\Builder\ListBuilderInterface;
Expand Down Expand Up @@ -201,7 +200,7 @@ public function getForm();
/**
* NEXT MAJOR: Remove the throws tag.
*
* @throws RuntimeException if no request is set
* @throws \RuntimeException if no request is set
*
* @return Request
*/
Expand Down
3 changes: 1 addition & 2 deletions src/Admin/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Sonata\AdminBundle\Admin;

use InvalidArgumentException;
use Sonata\AdminBundle\Templating\MutableTemplateRegistryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
Expand Down Expand Up @@ -381,7 +380,7 @@ public function getInstance($id)
$admin = $this->container->get($id);

if (!$admin instanceof AdminInterface) {
throw new InvalidArgumentException(sprintf('Found service "%s" is not a valid admin service', $id));
throw new \InvalidArgumentException(sprintf('Found service "%s" is not a valid admin service', $id));
}

return $admin;
Expand Down
3 changes: 1 addition & 2 deletions tests/Command/ExplainAdminCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Sonata\AdminBundle\Tests\Command;

use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Admin\FieldDescriptionInterface;
Expand Down Expand Up @@ -278,7 +277,7 @@ public function testExecuteNonAdminService(): void
$command = $this->application->find('sonata:admin:explain');
$commandTester = new CommandTester($command);

$this->expectException(InvalidArgumentException::class);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Admin service "nonexistent.service" not found in admin pool. Did you mean "acme.admin.bar" or one of those: []');

$commandTester->execute(['command' => $command->getName(), 'admin' => 'nonexistent.service']);
Expand Down

0 comments on commit a08dfb9

Please sign in to comment.