Permalink
Browse files

CS fixer conf & fixes

  • Loading branch information...
1 parent dec9694 commit dd5d7b2d455aa83d0547a2cbdbdb1119e5d6f120 @ogizanagi ogizanagi committed Oct 28, 2015
View
@@ -1,4 +1,4 @@
-/build
+.php_cs.cache
composer.lock
phpunit.xml
vendor/*
View
@@ -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)
+;
@@ -462,7 +462,6 @@ private function introspectGettersAndSetters($entityConfiguration)
return $entityConfiguration;
}
-
/**
* Determines the template used to render each backend element. This is not
* trivial because templates can depend on the entity displayed and they
@@ -645,6 +645,7 @@ protected function createEntityForm($entity, array $entityProperties, $view)
$customMethodName, is_object($form) ? get_class($form) : gettype($form)
));
}
+
return $form;
}
@@ -349,7 +349,7 @@ private function normalizeActionsConfiguration(array $actionsConfiguration, arra
// those options would be 'null' and the template would show some issues
if (array_key_exists($actionName, $defaultActionsConfiguration)) {
// 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);
}
}
@@ -605,8 +605,9 @@ private function normalizeFieldsConfiguration(array $fieldsConfiguration, $view,
/**
* Checks whether the given string is valid as a PHP method name.
*
- * @param string $name
- * @return boolean
+ * @param string $name
+ *
+ * @return bool
*/
private function isValidMethodName($name)
{
@@ -38,7 +38,6 @@ public function onKernelException(GetResponseForExceptionEvent $event)
return $event->getException()->getMessage();
}
- /** @var \JavierEguiluz\Bundle\EasyAdminBundle\Exception\BaseException */
$exception = $event->getException();
$exceptionClassName = basename(str_replace('\\', '/', get_class($exception)));
@@ -84,6 +84,7 @@ class Product
* <li><strong>Size</strong>: 13cm x 15cm x 6cm</li>
* <li><strong>Bluetooth</strong>: 4.1</li>
* </ul></pre>
+ *
* @var string
* @ORM\Column(type="string")
*/
@@ -3,8 +3,8 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Listener;
/**
-* Test class for event listener test
-*/
+ * Test class for event listener test
+ */
class EntityNotFoundException extends \Exception
{
}
@@ -50,9 +50,9 @@ public function testCatchBaseExceptions()
array(
'entity' => array(
'name' => 'Test',
- 'primary_key_field_name' => 'Test key'
+ 'primary_key_field_name' => 'Test key',
),
- 'entity_id' => 2
+ 'entity_id' => 2,
)
);
$event = $this->getEventExceptionThatShouldBeCalledOnce($exception);
@@ -78,7 +78,7 @@ private function getEventExceptionThatShouldNotBeCalled($exception)
public function testShouldNotCatchExceptionsWithSameName()
{
- $exception = new EntityNotFoundException;
+ $exception = new EntityNotFoundException();
$event = $this->getEventExceptionThatShouldNotBeCalled($exception);
$templating = $this->getTemplating();
$debug = false;

0 comments on commit dd5d7b2

Please sign in to comment.