Ver código fonte

Merge pull request #2149 from pborreli/typos-19

Fixed typos
Thomas 11 anos atrás
pai
commit
4b7cd58c1e
46 arquivos alterados com 159 adições e 164 exclusões
  1. 1 1
      Block/AdminSearchBlockService.php
  2. 0 1
      Builder/ListBuilderInterface.php
  3. 0 1
      Builder/ShowBuilderInterface.php
  4. 1 1
      Controller/CRUDController.php
  5. 1 1
      Datagrid/Datagrid.php
  6. 1 1
      Form/Type/ModelTypeList.php
  7. 3 3
      Mapper/BaseGroupedMapper.php
  8. 9 10
      Mapper/BaseMapper.php
  9. 1 1
      Resources/doc/cookbook/recipe_dynamic_form_modification.rst
  10. 2 2
      Resources/doc/cookbook/recipe_file_uploads.rst
  11. 2 2
      Resources/doc/cookbook/recipe_sortable_listing.rst
  12. 1 1
      Resources/doc/reference/action_create_edit.rst
  13. 1 1
      Resources/doc/reference/action_delete.rst
  14. 1 1
      Resources/doc/reference/action_export.rst
  15. 2 2
      Resources/doc/reference/action_list.rst
  16. 1 1
      Resources/doc/reference/action_show.rst
  17. 1 1
      Resources/doc/reference/advanced.rst
  18. 1 1
      Resources/doc/reference/architecture.rst
  19. 1 1
      Resources/doc/reference/batch_actions.rst
  20. 1 1
      Resources/doc/reference/events.rst
  21. 1 1
      Resources/doc/reference/field_types.rst
  22. 1 1
      Resources/doc/reference/routing.rst
  23. 3 3
      Resources/doc/reference/security.rst
  24. 1 1
      Resources/doc/reference/templates.rst
  25. 1 1
      Tests/Admin/AdminTest.php
  26. 1 1
      Tests/Admin/BaseFieldDescriptionTest.php
  27. 1 1
      Tests/Admin/FieldDescriptionCollectionTest.php
  28. 1 1
      Tests/Command/GenerateAdminCommandTest.php
  29. 85 85
      Tests/Controller/CRUDControllerTest.php
  30. 3 3
      Tests/Datagrid/DatagridMapperTest.php
  31. 1 1
      Tests/Datagrid/DatagridTest.php
  32. 3 3
      Tests/Datagrid/ListMapperTest.php
  33. 1 1
      Tests/DependencyInjection/Compiler/ExtensionCompilerPassTest.php
  34. 1 1
      Tests/Fixtures/Admin/CommentAdmin.php
  35. 1 1
      Tests/Fixtures/Admin/PostAdmin.php
  36. 0 1
      Tests/Fixtures/Admin/TagAdmin.php
  37. 1 1
      Tests/Fixtures/Bundle/DemoAdminBundle.php
  38. 1 1
      Tests/Fixtures/Bundle/Entity/Post.php
  39. 1 1
      Tests/Fixtures/Bundle/Entity/Tag.php
  40. 1 1
      Tests/Fixtures/Command/classes.php
  41. 1 2
      Tests/Fixtures/Entity/Form/FooEntity.php
  42. 2 2
      Tests/Form/DataTransformer/ModelToIdTransformerTest.php
  43. 2 2
      Tests/Form/DataTransformer/ModelsToArrayTransformerTest.php
  44. 9 9
      Tests/Model/AuditManagerTest.php
  45. 3 3
      Tests/Route/DefaultRouteGeneratorTest.php
  46. 2 2
      Tests/Show/ShowMapperTest.php

+ 1 - 1
Block/AdminSearchBlockService.php

@@ -123,4 +123,4 @@ class AdminSearchBlockService extends BaseBlockService
             'per_page'   => 10,
         ));
     }
-}
+}

+ 0 - 1
Builder/ListBuilderInterface.php

@@ -42,5 +42,4 @@ interface ListBuilderInterface extends BuilderInterface
      * @param \Sonata\AdminBundle\Admin\AdminInterface             $admin
      */
     public function addField(FieldDescriptionCollection $list, $type = null, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
-
 }

+ 0 - 1
Builder/ShowBuilderInterface.php

@@ -37,5 +37,4 @@ interface ShowBuilderInterface extends BuilderInterface
      * @return void
      */
     public function addField(FieldDescriptionCollection $list, $type = null, FieldDescriptionInterface $fieldDescription, AdminInterface $admin);
-
 }

+ 1 - 1
Controller/CRUDController.php

@@ -204,7 +204,7 @@ class CRUDController extends Controller
         try {
             $modelManager->batchDelete($this->admin->getClass(), $query);
             $this->addFlash('sonata_flash_success', 'flash_batch_delete_success');
-        } catch ( ModelManagerException $e ) {
+        } catch (ModelManagerException $e) {
             $this->addFlash('sonata_flash_error', 'flash_batch_delete_error');
         }
 

+ 1 - 1
Datagrid/Datagrid.php

@@ -121,7 +121,7 @@ class Datagrid implements DatagridInterface
 
         if (isset($this->values['_sort_by'])) {
             if (!$this->values['_sort_by'] instanceof FieldDescriptionInterface) {
-                throw new UnexpectedTypeException($this->values['_sort_by'],'FieldDescriptionInterface');
+                throw new UnexpectedTypeException($this->values['_sort_by'], 'FieldDescriptionInterface');
             }
 
             if ($this->values['_sort_by']->isSortable()) {

+ 1 - 1
Form/Type/ModelTypeList.php

@@ -23,7 +23,7 @@ use Sonata\AdminBundle\Form\DataTransformer\ModelToIdTransformer;
 /**
  * This type is used to render an hidden input text and 3 links
  *   - an add form modal
- *   - a list modal to select the targetted entities
+ *   - a list modal to select the targeted entities
  *   - a clear selection link
  */
 class ModelTypeList extends AbstractType

+ 3 - 3
Mapper/BaseGroupedMapper.php

@@ -19,10 +19,10 @@ abstract class BaseGroupedMapper extends BaseMapper
 
     protected $currentGroup;
 
-    protected abstract function getGroups();
-
-    protected abstract function setGroups(array $groups);
+    abstract protected function getGroups();
 
+    abstract protected function setGroups(array $groups);
+    
     /**
      * @param string $name
      * @param array  $options

+ 9 - 10
Mapper/BaseMapper.php

@@ -21,9 +21,9 @@ abstract class BaseMapper
 {
 
     protected $admin;
-    
+
     protected $builder;
-    
+
     /**
      * @param \Sonata\AdminBundle\Builder\BuilderInterface $builder
      * @param \Sonata\AdminBundle\Admin\AdminInterface     $admin
@@ -33,7 +33,7 @@ abstract class BaseMapper
         $this->builder = $builder;
         $this->admin   = $admin;
     }
-    
+
     /**
      * @return \Sonata\AdminBundle\Admin\AdminInterface
      */
@@ -41,33 +41,32 @@ abstract class BaseMapper
     {
         return $this->admin;
     }
-    
+
     /**
      * @param string $key
      *
      * @return mixed
      */
-    public abstract function get($key);
+    abstract public function get($key);
 
     /**
      * @param string $key
      *
      * @return boolean
      */
-    public abstract function has($key);
+    abstract public function has($key);
 
     /**
      * @param string $key
      *
      * @return \Sonata\AdminBundle\Mapper\BaseMapper
      */
-    public abstract function remove($key);
-    
+    abstract public function remove($key);
+
     /**
      * @param array $keys field names
      *
      * @return \Sonata\AdminBundle\Mapper\BaseMapper
      */
-    public abstract function reorder(array $keys);
-    
+    abstract public function reorder(array $keys);
 }

+ 1 - 1
Resources/doc/cookbook/recipe_dynamic_form_modification.rst

@@ -1,7 +1,7 @@
 Modifying form fields dynamically depending on edited object
 ============================================================
 
-It's a quite common situation when you need to modify your form's fields because of edited object's properties or structure. Let's assume you only want to display an admin form field for new objects and you don't want it to be shown for those objects that have alerady been saved to the database and now are being edited.
+It's a quite common situation when you need to modify your form's fields because of edited object's properties or structure. Let's assume you only want to display an admin form field for new objects and you don't want it to be shown for those objects that have already been saved to the database and now are being edited.
 
 This is a way for you to accomplish this. 
 

+ 2 - 2
Resources/doc/cookbook/recipe_file_uploads.rst

@@ -299,8 +299,8 @@ happening.
 Notes
 -----
 
-If you are looking for richer media management fucntionality there is a complete SonataMediaBundle
-which caters to this need. It is documentated online and is created and maintained by the same team
+If you are looking for richer media management functionality there is a complete SonataMediaBundle
+which caters to this need. It is documented online and is created and maintained by the same team
 as SonataAdmin.
 
 To learn how to add an image preview to your ImageAdmin take a look at the related cookbook entry.

+ 2 - 2
Resources/doc/cookbook/recipe_sortable_listing.rst

@@ -39,7 +39,7 @@ First of are going to add a position field in our ``Client`` entity.
 
 
 
-In ``ClientAdmin`` our we are going to add in the ``configureListFields`` method a custom action and use the default twig template provided in the pixSortableBehavioBundle
+In ``ClientAdmin`` our we are going to add in the ``configureListFields`` method a custom action and use the default twig template provided in the PixSortableBehaviorBundle
 
 .. code-block:: php
 
@@ -63,7 +63,7 @@ In order to add new routes for these actions we are also adding the following me
 
 
 
-Now you can update your ``admin.yml`` to use the handler provider by the pixSortableBehavioBundle
+Now you can update your ``admin.yml`` to use the handler provider by the PixSortableBehaviorBundle
 
 .. code-block:: yaml
 

+ 1 - 1
Resources/doc/reference/action_create_edit.rst

@@ -74,4 +74,4 @@ To do:
 - how to create settings/fields that appear on just one of the create/edit views
   and any controller changes needed to manage them
 
-.. _`issues on Github`: https://github.com/sonata-project/SonataAdminBundle/issues/1519
+.. _`issues on GitHub`: https://github.com/sonata-project/SonataAdminBundle/issues/1519

+ 1 - 1
Resources/doc/reference/action_delete.rst

@@ -5,7 +5,7 @@ Deleting objects
 
     This document is a stub representing a new work in progress. If you're reading 
     this you can help contribute, **no matter what your experience level with Sonata 
-    is**. Check out the `issues on Github`_ for more information about how to get involved.
+    is**. Check out the `issues on GitHub`_ for more information about how to get involved.
 
 This document will cover the Delete action and any related configuration options.
 

+ 1 - 1
Resources/doc/reference/action_export.rst

@@ -5,7 +5,7 @@ The Export action
 
     This document is a stub representing a new work in progress. If you're reading
     this you can help contribute, **no matter what your experience level with Sonata
-    is**. Check out the `issues on Github`_ for more information about how to get involved.
+    is**. Check out the `issues on GitHub`_ for more information about how to get involved.
 
 This document will cover the Export action and related configuration options.
 

+ 2 - 2
Resources/doc/reference/action_list.rst

@@ -5,7 +5,7 @@ The List View
 
     This document is a stub representing a new work in progress. If you're reading
     this you can help contribute, **no matter what your experience level with Sonata
-    is**. Check out the `issues on Github`_ for more information about how to get involved.
+    is**. Check out the `issues on GitHub`_ for more information about how to get involved.
 
 This document will cover the List view which you use to browse the objects in your
 system. It will cover configuration of the list itself and the filters you can use
@@ -228,4 +228,4 @@ To do:
 - targeting submodel fields using dot-separated notation
 - advanced filter options (global_search)
 
-.. _`issues on Github`: https://github.com/sonata-project/SonataAdminBundle/issues/1519
+.. _`issues on GitHub`: https://github.com/sonata-project/SonataAdminBundle/issues/1519

+ 1 - 1
Resources/doc/reference/action_show.rst

@@ -5,7 +5,7 @@ The Show action
 
     This document is a stub representing a new work in progress. If you're reading
     this you can help contribute, **no matter what your experience level with Sonata
-    is**. Check out the ``issues on Github`` _ for more information about how to get involved.
+    is**. Check out the ``issues on GitHub`` _ for more information about how to get involved.
 
 This document will cover the Show action and related configuration options.
 

+ 1 - 1
Resources/doc/reference/advanced.rst

@@ -150,7 +150,7 @@ To create your own RouteBuilder create the PHP class and register it as a servic
         {
             parent::build($admin,$collection);
             $collection->add('yourSubAction');
-            // Create button will dissappear, delete functionality will be disabled as well
+            // Create button will disappear, delete functionality will be disabled as well
             // No more changes needed!
             $collection->remove('create');
             $collection->remove('delete');

+ 1 - 1
Resources/doc/reference/architecture.rst

@@ -262,7 +262,7 @@ you will also find instructions on how to configure ``SonataAdminBundle`` to use
 instead of the default ones.
 
 Managing ``Admin`` Service
-------------------------------
+--------------------------
 
 Your ``Admin`` service definitions are parsed when Symfony2 is loaded, and handled by
 the ``Pool`` class. This class, available as the ``sonata.admin.pool`` service from the

+ 1 - 1
Resources/doc/reference/batch_actions.rst

@@ -139,7 +139,7 @@ This method may return three different values:
 (Optional) Executing a pre batch hook
 -------------------------------------
 
-In your admin class you can create a ``preBacthAction`` method to execute something before doing the batch action.
+In your admin class you can create a ``preBatchAction`` method to execute something before doing the batch action.
 The main purpose of this method is to alter the query or the list of selected id.
 
 .. code-block:: php

+ 1 - 1
Resources/doc/reference/events.rst

@@ -32,7 +32,7 @@ ConfigureQueryEvent
 This event is generated when a list query is defined. The event name is: ``sonata.admin.event.configure.query``
 
 BlockEvent
-~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~
 
 Block events help you customize your templates. Available events are :
 

+ 1 - 1
Resources/doc/reference/field_types.rst

@@ -63,7 +63,7 @@ Parameters:
 * **url**: url address (e.g. ``http://example.com``)
 * **route.name**: route name (e.g. ``acme_demo_homepage``)
 * **route.parameters**: array of route parameters (e.g. ``array('type'=>'example', 'display'=>'full')``)
-* **route.absolute**: boolean value, create absolute or relative url address based on ``route.name`` and  ``route.parameters`` (defalut ``false``)
+* **route.absolute**: boolean value, create absolute or relative url address based on ``route.name`` and  ``route.parameters`` (default ``false``)
 * **route.identifier_parameter_name**: parameter added to ``route.parameters``, it's value is an object identifier (e.g. 'id') to create dynamic links based on rendered objects.
 
 .. code-block:: php

+ 1 - 1
Resources/doc/reference/routing.rst

@@ -102,7 +102,7 @@ explicitly this defaults to the action name.
     {
         protected function configureRoutes(RouteCollection $collection)
         {
-            $collection->add('myCustom'); #Action gets added automaticly
+            $collection->add('myCustom'); // Action gets added automatically
             $collection->add('view', $this->getRouterIdParameter().'/view');
         }
     }

+ 3 - 3
Resources/doc/reference/security.rst

@@ -91,7 +91,7 @@ Later, we will explain how to set up ACL with the
 ``FriendsOfSymfony/UserBundle``.
 
 Role handler
------------------
+------------
 
 The ``sonata.admin.security.handler.role`` allows you to operate finely on the actions that can be done (depending on the entity class), without requiring to set up ACL.
 
@@ -476,14 +476,14 @@ or a permission (``admin.isGranted``):
 
 - **Token:** a token identifies a user between requests;
 - **Voter:** sort of judge that returns if access is granted of denied, if the
-  voter should not vote for a case, it returns abstrain;
+  voter should not vote for a case, it returns abstain;
 - **AccessDecisionManager:** decides if access is granted or denied according
   a specific strategy. It grants access if at least one (affirmative strategy),
   all (unanimous strategy) or more then half (consensus strategy) of the
   counted votes granted access;
 - **RoleVoter:** votes for all attributes stating with ``ROLE_`` and grants
   access if the user has this role;
-- **RoleHierarchieVoter:** when the role ``ROLE_SONATA_ADMIN`` is voted for,
+- **RoleHierarchyVoter:** when the role ``ROLE_SONATA_ADMIN`` is voted for,
   it also votes "granted" if the user has the role ``ROLE_SUPER_ADMIN``;
 - **AclVoter:** grants access for the permissions of the ``Admin`` class if
   the user has the permission, the user has a permission that is included in

+ 1 - 1
Resources/doc/reference/templates.rst

@@ -71,7 +71,7 @@ Other Templates
 There are several other templates that can be customized, enabling you to fine-tune
 ``SonataAdminBundle``:
 
-* user_block: customizes the Twig block rendered by default in the top right corner of the admin interface, containing user information. Empty by defautl, see ``SonataUserBundle`` for a real example.
+* user_block: customizes the Twig block rendered by default in the top right corner of the admin interface, containing user information. Empty by default, see ``SonataUserBundle`` for a real example.
 * add_block: customizes the Twig block rendered by default in the top right corner of the admin interface, providing quick access to create operations on available admin classes.
 * history_revision_timestamp: customizes the way timestamps are rendered when using history related actions.
 * action: a generic template you can use for your custom actions

+ 1 - 1
Tests/Admin/AdminTest.php

@@ -848,7 +848,7 @@ class AdminTest extends \PHPUnit_Framework_TestCase
         $securityHandler=$this->getMock('Sonata\AdminBundle\Security\Handler\AclSecurityHandlerInterface');
         $securityHandler->expects($this->any())
             ->method('isGranted')
-            ->will($this->returnCallback(function (AdminInterface $adminIn, $attributes, $object = nul) use ($admin, $entity) {
+            ->will($this->returnCallback(function (AdminInterface $adminIn, $attributes, $object = null) use ($admin, $entity) {
                 if ($admin == $adminIn && $attributes == 'FOO') {
                     if (($object == $admin) || ($object == $entity)) {
                         return true;

+ 1 - 1
Tests/Admin/BaseFieldDescriptionTest.php

@@ -124,7 +124,7 @@ class BaseFieldDescriptionTest extends \PHPUnit_Framework_TestCase
          */
         $arg2 = 4;
         $twoParameters = array($arg1,$arg2);
-        $description2 = new FieldDescription();        
+        $description2 = new FieldDescription();
         $description2->setOption('code', 'getWithTwoParameters');
         $description2->setOption('parameters', $twoParameters);
         

+ 1 - 1
Tests/Admin/FieldDescriptionCollectionTest.php

@@ -111,4 +111,4 @@ class FieldDescriptionCollectionTest extends \PHPUnit_Framework_TestCase
         $actualElements = array_keys($collection->getElements());
         $this->assertSame($newOrder, $actualElements, 'the order is wrong');
     }
-}
+}

+ 1 - 1
Tests/Command/GenerateAdminCommandTest.php

@@ -49,7 +49,7 @@ class GenerateAdminCommandTest extends \PHPUnit_Framework_TestCase
     protected function setUp()
     {
         // create temp dir
-        $tempfile=tempnam(sys_get_temp_dir(),'sonata_admin');
+        $tempfile = tempnam(sys_get_temp_dir(), 'sonata_admin');
         if (file_exists($tempfile)) {
             unlink($tempfile);
         }

+ 85 - 85
Tests/Controller/CRUDControllerTest.php

@@ -112,16 +112,16 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $templating->expects($this->any())
             ->method('renderResponse')
             ->will($this->returnCallback(function($view, array $parameters = array(), Response $response = null) use (&$params, &$template) {
-                    $template = $view;
+                $template = $view;
 
-                    if (null === $response) {
-                        $response = new Response();
-                    }
+                if (null === $response) {
+                    $response = new Response();
+                }
 
-                    $params = $parameters;
+                $params = $parameters;
 
-                    return $response;
-                }));
+                return $response;
+            }));
 
         $this->session = new Session(new MockArraySessionStorage());
 
@@ -142,13 +142,13 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $twig->expects($this->any())
             ->method('getExtension')
             ->will($this->returnCallback(function($name) use ($formExtension) {
-                    switch ($name) {
-                        case 'form':
-                            return $formExtension;
-                    }
+                switch ($name) {
+                    case 'form':
+                        return $formExtension;
+                }
 
-                    return null;
-                }));
+                return null;
+            }));
 
         $exporter = $this->getMock('Sonata\AdminBundle\Export\Exporter');
 
@@ -177,66 +177,66 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $this->container->expects($this->any())
             ->method('get')
             ->will($this->returnCallback(function($id) use ($pool, $request, $admin, $templating, $twig, $session, $exporter, $auditManager, $adminObjectAclManipulator, $requestStack) {
-                    switch ($id) {
-                        case 'sonata.admin.pool':
-                            return $pool;
-                        case 'request_stack':
-                            return $requestStack;
-                        case 'request':
-                            return $request;
-                        case 'foo.admin':
-                            return $admin;
-                        case 'templating':
-                            return $templating;
-                        case 'twig':
-                            return $twig;
-                        case 'session':
-                            return $session;
-                        case 'sonata.admin.exporter':
-                            return $exporter;
-                        case 'sonata.admin.audit.manager':
-                            return $auditManager;
-                        case 'sonata.admin.object.manipulator.acl.admin':
-                            return $adminObjectAclManipulator;
-                    }
-
-                    return null;
-                }));
+                switch ($id) {
+                    case 'sonata.admin.pool':
+                        return $pool;
+                    case 'request_stack':
+                        return $requestStack;
+                    case 'request':
+                        return $request;
+                    case 'foo.admin':
+                        return $admin;
+                    case 'templating':
+                        return $templating;
+                    case 'twig':
+                        return $twig;
+                    case 'session':
+                        return $session;
+                    case 'sonata.admin.exporter':
+                        return $exporter;
+                    case 'sonata.admin.audit.manager':
+                        return $auditManager;
+                    case 'sonata.admin.object.manipulator.acl.admin':
+                        return $adminObjectAclManipulator;
+                }
+
+                return null;
+            }));
 
         $this->admin->expects($this->any())
             ->method('getTemplate')
             ->will($this->returnCallback(function($name) {
-                    switch ($name) {
-                        case 'ajax':
-                            return 'SonataAdminBundle::ajax_layout.html.twig';
-                        case 'layout':
-                            return 'SonataAdminBundle::standard_layout.html.twig';
-                        case 'show':
-                            return 'SonataAdminBundle:CRUD:show.html.twig';
-                        case 'edit':
-                            return 'SonataAdminBundle:CRUD:edit.html.twig';
-                        case 'dashboard':
-                            return 'SonataAdminBundle:Core:dashboard.html.twig';
-                        case 'search':
-                            return 'SonataAdminBundle:Core:search.html.twig';
-                        case 'list':
-                            return 'SonataAdminBundle:CRUD:list.html.twig';
-                        case 'preview':
-                            return 'SonataAdminBundle:CRUD:preview.html.twig';
-                        case 'history':
-                            return 'SonataAdminBundle:CRUD:history.html.twig';
-                        case 'acl':
-                            return 'SonataAdminBundle:CRUD:acl.html.twig';
-                        case 'delete':
-                            return 'SonataAdminBundle:CRUD:delete.html.twig';
-                        case 'batch':
-                            return 'SonataAdminBundle:CRUD:list__batch.html.twig';
-                        case 'batch_confirmation':
-                            return 'SonataAdminBundle:CRUD:batch_confirmation.html.twig';
-                    }
-
-                    return null;
-                }));
+                switch ($name) {
+                    case 'ajax':
+                        return 'SonataAdminBundle::ajax_layout.html.twig';
+                    case 'layout':
+                        return 'SonataAdminBundle::standard_layout.html.twig';
+                    case 'show':
+                        return 'SonataAdminBundle:CRUD:show.html.twig';
+                    case 'edit':
+                        return 'SonataAdminBundle:CRUD:edit.html.twig';
+                    case 'dashboard':
+                        return 'SonataAdminBundle:Core:dashboard.html.twig';
+                    case 'search':
+                        return 'SonataAdminBundle:Core:search.html.twig';
+                    case 'list':
+                        return 'SonataAdminBundle:CRUD:list.html.twig';
+                    case 'preview':
+                        return 'SonataAdminBundle:CRUD:preview.html.twig';
+                    case 'history':
+                        return 'SonataAdminBundle:CRUD:history.html.twig';
+                    case 'acl':
+                        return 'SonataAdminBundle:CRUD:acl.html.twig';
+                    case 'delete':
+                        return 'SonataAdminBundle:CRUD:delete.html.twig';
+                    case 'batch':
+                        return 'SonataAdminBundle:CRUD:list__batch.html.twig';
+                    case 'batch_confirmation':
+                        return 'SonataAdminBundle:CRUD:batch_confirmation.html.twig';
+                }
+
+                return null;
+            }));
 
         $this->admin->expects($this->any())
             ->method('getIdParameter')
@@ -245,24 +245,24 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $this->admin->expects($this->any())
             ->method('generateUrl')
             ->will($this->returnCallback(function($name, array $parameters = array(), $absolute = false) {
-                    $result = $name;
-                    if (!empty($parameters)) {
-                        $result .= '?'.http_build_query($parameters);
-                    }
+                $result = $name;
+                if (!empty($parameters)) {
+                    $result .= '?'.http_build_query($parameters);
+                }
 
-                    return $result;
-                }));
+                return $result;
+            }));
 
         $this->admin->expects($this->any())
             ->method('generateObjectUrl')
             ->will($this->returnCallback(function($name, $object, array $parameters = array(), $absolute = false) {
-                    $result = get_class($object).'_'.$name;
-                    if (!empty($parameters)) {
-                        $result .= '?'.http_build_query($parameters);
-                    }
+                $result = get_class($object).'_'.$name;
+                if (!empty($parameters)) {
+                    $result .= '?'.http_build_query($parameters);
+                }
 
-                    return $result;
-                }));
+                return $result;
+            }));
 
         $this->controller = new CRUDController();
         $this->controller->setContainer($this->container);
@@ -332,8 +332,8 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $this->admin->expects($this->once())
             ->method('setUniqid')
             ->will($this->returnCallback(function($uniqid) use (&$uniqueId) {
-                    $uniqueId = $uniqid;
-                }));
+                $uniqueId = $uniqid;
+            }));
 
         $this->request->query->set('uniqid', 123456);
         $this->protectedTestedMethods['configure']->invoke($this->controller);
@@ -349,8 +349,8 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $this->admin->expects($this->once())
             ->method('setUniqid')
             ->will($this->returnCallback(function($uniqid) use (&$uniqueId) {
-                    $uniqueId = $uniqid;
-                }));
+                $uniqueId = $uniqid;
+            }));
 
         $this->admin->expects($this->once())
             ->method('isChild')

+ 3 - 3
Tests/Datagrid/DatagridMapperTest.php

@@ -225,7 +225,7 @@ class DatagridMapperTest extends \PHPUnit_Framework_TestCase
             'fooName2',
             'fooName3',
             'fooName4',
-       ), array_keys($this->datagrid->getFilters()));
+        ), array_keys($this->datagrid->getFilters()));
 
         $this->datagridMapper->reorder(array('fooName3', 'fooName2', 'fooName1', 'fooName4'));
 
@@ -234,10 +234,10 @@ class DatagridMapperTest extends \PHPUnit_Framework_TestCase
             'fooName2',
             'fooName1',
             'fooName4',
-       ), array_keys($this->datagrid->getFilters()));
+        ), array_keys($this->datagrid->getFilters()));
     }
 
-    private function getFieldDescriptionMock($name=null, $label=null)
+    private function getFieldDescriptionMock($name = null, $label = null)
     {
         $fieldDescription = $this->getMockForAbstractClass('Sonata\AdminBundle\Admin\BaseFieldDescription');
 

+ 1 - 1
Tests/Datagrid/DatagridTest.php

@@ -81,7 +81,7 @@ class DatagridTest extends \PHPUnit_Framework_TestCase
         $this->formBuilder->expects($this->any())
             ->method('add')
             ->will($this->returnCallback(function($name, $type, $options) use (& $formTypes, $eventDispatcher, $formFactory) {
-                $formTypes[$name] = new FormBuilder($name, 'Sonata\AdminBundle\Tests\Fixtures\Entity\Form\TestEntity', $eventDispatcher,  $formFactory, $options);
+                $formTypes[$name] = new FormBuilder($name, 'Sonata\AdminBundle\Tests\Fixtures\Entity\Form\TestEntity', $eventDispatcher, $formFactory, $options);
 
                 return null;
             }));

+ 3 - 3
Tests/Datagrid/ListMapperTest.php

@@ -187,7 +187,7 @@ class ListMapperTest extends \PHPUnit_Framework_TestCase
             'fooName2'=>$fieldDescription2,
             'fooName3'=>$fieldDescription3,
             'fooName4'=>$fieldDescription4,
-       ), $this->fieldDescriptionCollection->getElements());
+        ), $this->fieldDescriptionCollection->getElements());
 
         $this->listMapper->reorder(array('fooName3', 'fooName2', 'fooName1', 'fooName4'));
 
@@ -197,11 +197,11 @@ class ListMapperTest extends \PHPUnit_Framework_TestCase
             'fooName2'=>$fieldDescription2,
             'fooName1'=>$fieldDescription1,
             'fooName4'=>$fieldDescription4,
-       ), true), print_r($this->fieldDescriptionCollection->getElements(), true));
+        ), true), print_r($this->fieldDescriptionCollection->getElements(), true));
 
     }
 
-    private function getFieldDescriptionMock($name=null, $label=null)
+    private function getFieldDescriptionMock($name = null, $label = null)
     {
         $fieldDescription = $this->getMockForAbstractClass('Sonata\AdminBundle\Admin\BaseFieldDescription');
 

+ 1 - 1
Tests/DependencyInjection/Compiler/ExtensionCompilerPassTest.php

@@ -76,7 +76,7 @@ class ExtensionCompilerPassTest extends \PHPUnit_Framework_TestCase
         $extensionMap = $container->getParameter($this->root . ".extension.map");
 
         $method = new \ReflectionMethod(
-          'Sonata\AdminBundle\DependencyInjection\Compiler\ExtensionCompilerPass', 'flattenExtensionConfiguration'
+            'Sonata\AdminBundle\DependencyInjection\Compiler\ExtensionCompilerPass', 'flattenExtensionConfiguration'
         );
 
         $method->setAccessible(TRUE);

+ 1 - 1
Tests/Fixtures/Admin/CommentAdmin.php

@@ -25,4 +25,4 @@ class CommentAdmin extends Admin
     {
         $this->parentAssociationMapping = $associationMapping;
     }
-}
+}

+ 1 - 1
Tests/Fixtures/Admin/PostAdmin.php

@@ -26,4 +26,4 @@ class PostAdmin extends Admin
 
         return parent::getClassMetaData();
     }
-}
+}

+ 0 - 1
Tests/Fixtures/Admin/TagAdmin.php

@@ -13,4 +13,3 @@ class TagAdmin extends Admin
         }
     }
 }
-

+ 1 - 1
Tests/Fixtures/Bundle/DemoAdminBundle.php

@@ -4,7 +4,7 @@ namespace Sonata\AdminBundle\Tests\Fixtures\Bundle;
 
 use Symfony\Component\HttpKernel\Bundle\Bundle;
 
-class DemoAdminBundle  extends Bundle
+class DemoAdminBundle extends Bundle
 {
     protected $path = null;
 

+ 1 - 1
Tests/Fixtures/Bundle/Entity/Post.php

@@ -23,7 +23,7 @@ class Post
         return $this->tags;
     }
 
-    public  function addTag(Tag $tag)
+    public function addTag(Tag $tag)
     {
         $tag->addPost($this);
         $this->tags[] = ($tag);

+ 1 - 1
Tests/Fixtures/Bundle/Entity/Tag.php

@@ -23,7 +23,7 @@ class Tag
         return $this->posts;
     }
 
-    public  function addPost(Post $post)
+    public function addPost(Post $post)
     {
         $this->posts[] = $post;
     }

+ 1 - 1
Tests/Fixtures/Command/classes.php

@@ -1,4 +1,4 @@
-<?php 
+<?php
 namespace Sonata\AdminBundle\Tests\Fixtures\Controller
 {
 abstract class AbstractFooAdminController

+ 1 - 2
Tests/Fixtures/Entity/Form/FooEntity.php

@@ -6,9 +6,8 @@ class FooEntity
 {
     private $values;
 
-    public function __construct(array $values=array())
+    public function __construct(array $values = array())
     {
         $this->values = $values;
     }
-
 }

+ 2 - 2
Tests/Form/DataTransformer/ModelToIdTransformerTest.php

@@ -51,7 +51,7 @@ class ModelToIdTransformerTest extends \PHPUnit_Framework_TestCase
      */
     public function testReverseTransform($value, $expected)
     {
-        $transformer = new ModelToIdTransformer($this->modelManager,'TEST2');
+        $transformer = new ModelToIdTransformer($this->modelManager, 'TEST2');
 
         $this->modelManager->expects($this->any())->method('find');
 
@@ -74,7 +74,7 @@ class ModelToIdTransformerTest extends \PHPUnit_Framework_TestCase
             ->method('getIdentifierValues')
             ->will($this->returnValue(array(123)));
 
-        $transformer = new ModelToIdTransformer($this->modelManager,'TEST');
+        $transformer = new ModelToIdTransformer($this->modelManager, 'TEST');
 
         $this->assertNull($transformer->transform(null));
         $this->assertNull($transformer->transform(false));

+ 2 - 2
Tests/Form/DataTransformer/ModelsToArrayTransformerTest.php

@@ -149,7 +149,7 @@ class ModelsToArrayTransformerTest extends \PHPUnit_Framework_TestCase
         $entity2 =  new FooEntity(array('bar'));
         $entity3 =  new FooEntity(array('baz'));
 
-       $this->modelChoiceList->expects($this->any())
+        $this->modelChoiceList->expects($this->any())
             ->method('getEntity')
             ->will($this->returnCallback(function($key) use ($entity1, $entity2, $entity3) {
                 switch ($key) {
@@ -185,7 +185,7 @@ class ModelsToArrayTransformerTest extends \PHPUnit_Framework_TestCase
             ->method('getModelCollectionInstance')
             ->will($this->returnValue(new ArrayCollection()));
 
-       $this->modelChoiceList->expects($this->any())
+        $this->modelChoiceList->expects($this->any())
             ->method('getEntity')
             ->will($this->returnValue(false));
 

+ 9 - 9
Tests/Model/AuditManagerTest.php

@@ -31,17 +31,17 @@ class AuditManagerTest extends \PHPUnit_Framework_TestCase
         $container->expects($this->any())
             ->method('get')
             ->will($this->returnCallback(function($id) use ($fooReader, $barReader) {
-                    switch ($id) {
-                        case 'foo_reader':
-                            return $fooReader;
-                            break;
+                switch ($id) {
+                    case 'foo_reader':
+                        return $fooReader;
+                        break;
 
-                        case 'bar_reader':
-                            return $barReader;
-                            break;
-                    }
+                    case 'bar_reader':
+                        return $barReader;
+                        break;
+                }
 
-                    return null;
+                return null;
             }));
 
         $auditManager = new AuditManager($container);

+ 3 - 3
Tests/Route/DefaultRouteGeneratorTest.php

@@ -65,7 +65,7 @@ class DefaultRouteGeneratorTest extends \PHPUnit_Framework_TestCase
         $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
         $router->expects($this->once())
             ->method('generate')
-            ->will($this->returnCallback(function($name, array $parameters = array())  {
+            ->will($this->returnCallback(function($name, array $parameters = array()) {
                 $params = '';
                 if (!empty($parameters)) {
                     $params .= '?'.http_build_query($parameters);
@@ -168,7 +168,7 @@ class DefaultRouteGeneratorTest extends \PHPUnit_Framework_TestCase
         $router = $this->getMock('\Symfony\Component\Routing\RouterInterface');
         $router->expects($this->once())
             ->method('generate')
-            ->will($this->returnCallback(function($name, array $parameters = array())  {
+            ->will($this->returnCallback(function($name, array $parameters = array()) {
                 $params = '';
                 if (!empty($parameters)) {
                     $params .= '?'.http_build_query($parameters);
@@ -227,7 +227,7 @@ class DefaultRouteGeneratorTest extends \PHPUnit_Framework_TestCase
         $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
         $router->expects($this->once())
             ->method('generate')
-            ->will($this->returnCallback(function($name, array $parameters = array())  {
+            ->will($this->returnCallback(function($name, array $parameters = array()) {
                 $params = '';
                 if (!empty($parameters)) {
                     $params .= '?'.http_build_query($parameters);

+ 2 - 2
Tests/Show/ShowMapperTest.php

@@ -211,10 +211,10 @@ class ShowMapperTest extends \PHPUnit_Framework_TestCase
                 'fields' => array('fooName3'=>'fooName3', 'fooName2'=>'fooName2', 'fooName1'=>'fooName1', 'fooName4'=>'fooName4'),
                 'description' => false,
                 'translation_domain' => null,
-            )), true), print_r($this->admin->getShowGroups(), true));
+       )), true), print_r($this->admin->getShowGroups(), true));
     }
 
-    private function getFieldDescriptionMock($name=null, $label=null)
+    private function getFieldDescriptionMock($name = null, $label = null)
     {
         $fieldDescription = $this->getMockForAbstractClass('Sonata\AdminBundle\Admin\BaseFieldDescription');