Skip to content

Commit

Permalink
CS fixer conf & fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Oct 28, 2015
1 parent dec9694 commit dd5d7b2
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,4 +1,4 @@
/build .php_cs.cache
composer.lock composer.lock
phpunit.xml phpunit.xml
vendor/* vendor/*
Expand Down
12 changes: 12 additions & 0 deletions .php_cs
@@ -0,0 +1,12 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__)
->exclude(array('vendor', 'build'))
;

return Symfony\CS\Config\Config::create()
->setUsingCache(true)
->fixers(array('-unalign_double_arrow', '-phpdoc_short_description'))
->finder($finder)
;
1 change: 0 additions & 1 deletion Configuration/Configurator.php
Expand Up @@ -462,7 +462,6 @@ private function introspectGettersAndSetters($entityConfiguration)
return $entityConfiguration; return $entityConfiguration;
} }



/** /**
* Determines the template used to render each backend element. This is not * Determines the template used to render each backend element. This is not
* trivial because templates can depend on the entity displayed and they * trivial because templates can depend on the entity displayed and they
Expand Down
1 change: 1 addition & 0 deletions Controller/AdminController.php
Expand Up @@ -645,6 +645,7 @@ protected function createEntityForm($entity, array $entityProperties, $view)
$customMethodName, is_object($form) ? get_class($form) : gettype($form) $customMethodName, is_object($form) ? get_class($form) : gettype($form)
)); ));
} }

return $form; return $form;
} }


Expand Down
7 changes: 4 additions & 3 deletions DependencyInjection/EasyAdminExtension.php
Expand Up @@ -349,7 +349,7 @@ private function normalizeActionsConfiguration(array $actionsConfiguration, arra
// those options would be 'null' and the template would show some issues // those options would be 'null' and the template would show some issues
if (array_key_exists($actionName, $defaultActionsConfiguration)) { if (array_key_exists($actionName, $defaultActionsConfiguration)) {
// remove null config options but maintain empty options (this allows to set an empty label for the action) // remove null config options but maintain empty options (this allows to set an empty label for the action)
$normalizedConfiguration = array_filter($normalizedConfiguration, function($element) { return null !== $element; }); $normalizedConfiguration = array_filter($normalizedConfiguration, function ($element) { return null !== $element; });
$normalizedConfiguration = array_replace($defaultActionsConfiguration[$actionName], $normalizedConfiguration); $normalizedConfiguration = array_replace($defaultActionsConfiguration[$actionName], $normalizedConfiguration);
} }
} }
Expand Down Expand Up @@ -605,8 +605,9 @@ private function normalizeFieldsConfiguration(array $fieldsConfiguration, $view,
/** /**
* Checks whether the given string is valid as a PHP method name. * Checks whether the given string is valid as a PHP method name.
* *
* @param string $name * @param string $name
* @return boolean *
* @return bool
*/ */
private function isValidMethodName($name) private function isValidMethodName($name)
{ {
Expand Down
1 change: 0 additions & 1 deletion Listener/ExceptionListener.php
Expand Up @@ -38,7 +38,6 @@ public function onKernelException(GetResponseForExceptionEvent $event)
return $event->getException()->getMessage(); return $event->getException()->getMessage();
} }


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


Expand Down
1 change: 1 addition & 0 deletions Tests/Fixtures/AppTestBundle/Entity/Product.php
Expand Up @@ -84,6 +84,7 @@ class Product
* <li><strong>Size</strong>: 13cm x 15cm x 6cm</li> * <li><strong>Size</strong>: 13cm x 15cm x 6cm</li>
* <li><strong>Bluetooth</strong>: 4.1</li> * <li><strong>Bluetooth</strong>: 4.1</li>
* </ul></pre> * </ul></pre>
*
* @var string * @var string
* @ORM\Column(type="string") * @ORM\Column(type="string")
*/ */
Expand Down
4 changes: 2 additions & 2 deletions Tests/Listener/EntityNotFoundException.php
Expand Up @@ -3,8 +3,8 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Listener; namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Listener;


/** /**
* Test class for event listener test * Test class for event listener test
*/ */
class EntityNotFoundException extends \Exception class EntityNotFoundException extends \Exception
{ {
} }
6 changes: 3 additions & 3 deletions Tests/Listener/ExceptionListenerTest.php
Expand Up @@ -50,9 +50,9 @@ public function testCatchBaseExceptions()
array( array(
'entity' => array( 'entity' => array(
'name' => 'Test', 'name' => 'Test',
'primary_key_field_name' => 'Test key' 'primary_key_field_name' => 'Test key',
), ),
'entity_id' => 2 'entity_id' => 2,
) )
); );
$event = $this->getEventExceptionThatShouldBeCalledOnce($exception); $event = $this->getEventExceptionThatShouldBeCalledOnce($exception);
Expand All @@ -78,7 +78,7 @@ private function getEventExceptionThatShouldNotBeCalled($exception)


public function testShouldNotCatchExceptionsWithSameName() public function testShouldNotCatchExceptionsWithSameName()
{ {
$exception = new EntityNotFoundException; $exception = new EntityNotFoundException();
$event = $this->getEventExceptionThatShouldNotBeCalled($exception); $event = $this->getEventExceptionThatShouldNotBeCalled($exception);
$templating = $this->getTemplating(); $templating = $this->getTemplating();
$debug = false; $debug = false;
Expand Down

0 comments on commit dd5d7b2

Please sign in to comment.