Skip to content

Commit

Permalink
minor #382 Fixed minor issues reported by Scrutinizer (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the master branch (closes #382).

Discussion
----------

Fixed minor issues reported by Scrutinizer

Commits
-------

28dbba1 Fixed minor issues reported by Scrutinizer
  • Loading branch information
javiereguiluz committed Jul 7, 2015
2 parents 418a2ad + 28dbba1 commit 0b5e26a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/EasyAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,6 @@ private function normalizeFieldsConfiguration(array $fieldsConfiguration, $view,
*/
private function isValidMethodName($name)
{
return preg_match('/^-?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name, $matches);
return 0 !== preg_match('/^-?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name);
}
}
1 change: 1 addition & 0 deletions Listener/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
'EntityNotFoundException' => '@EasyAdmin/error/entity_not_found.html.twig',
);

/** @var \JavierEguiluz\Bundle\EasyAdminBundle\Exception\BaseException */
$exception = $event->getException();
$exceptionClassName = basename(str_replace('\\', '/', get_class($exception)));

Expand Down
5 changes: 3 additions & 2 deletions Tests/Controller/ReadOnlyBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Controller;

use Symfony\Component\DomCrawler\Crawler;
use JavierEguiluz\Bundle\EasyAdminBundle\Tests\Fixtures\AbstractTestCase;
use JavierEguiluz\Bundle\EasyAdminBundle\Exception\NoEntitiesConfiguredException;

Expand Down Expand Up @@ -49,15 +50,15 @@ public function testShowViewContaisNoDisabledActions()

public function testEditActionIsDisabled()
{
$crawler = $this->requestEditView();
$this->requestEditView();

$this->assertEquals(500, $this->client->getResponse()->getStatusCode());
$this->assertContains('The requested edit action is not allowed.', $this->client->getResponse()->getContent());
}

public function testNewActionIsDisabled()
{
$crawler = $this->requestNewView();
$this->requestNewView();

$this->assertEquals(500, $this->client->getResponse()->getStatusCode());
$this->assertContains('The requested new action is not allowed.', $this->client->getResponse()->getContent());
Expand Down
2 changes: 0 additions & 2 deletions Tests/Fixtures/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ protected function getBackendPage(array $parameters)
}

/**
* @param array $parameters
*
* @return Crawler
*/
protected function getBackendHomepage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getRandomEan()
$count = count($chars) - 1;
$ean13 = '';
do {
$ean13 .= $char = $chars[rand(0, $count)];
$ean13 .= $chars[rand(0, $count)];
} while (strlen($ean13) < 13);

$checksum = 0;
Expand Down

0 comments on commit 0b5e26a

Please sign in to comment.