Browse Source

Fixed typos

Pascal Borreli 11 years ago
parent
commit
0ae9a53241

+ 2 - 2
Admin/BaseFieldDescription.php

@@ -335,7 +335,7 @@ abstract class BaseFieldDescription implements FieldDescriptionInterface
             $getters[] = $this->getOption('code');
         }
         // parameters for the method given in the code option
-        if($this->getOption('parameters')){
+        if ($this->getOption('parameters')) {
             $parameters = $this->getOption('parameters');
         }
         $getters[] = 'get' . $camelizedFieldName;
@@ -343,7 +343,7 @@ abstract class BaseFieldDescription implements FieldDescriptionInterface
 
         foreach ($getters as $getter) {
             if (method_exists($object, $getter)) {
-                return call_user_func_array(array($object, $getter),$parameters);
+                return call_user_func_array(array($object, $getter), $parameters);
             }
         }
 

+ 3 - 3
Command/GenerateObjectAclCommand.php

@@ -118,13 +118,13 @@ class GenerateObjectAclCommand extends ContainerAwareCommand
     {
         if ($this->userEntityClass === '') {
             if ($input->getOption('user_entity')) {
-               list($userBundle, $userEntity) = Validators::validateEntityName($input->getOption('user_entity'));
-               $this->userEntityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($userBundle).'\\'.$userEntity;
+                list($userBundle, $userEntity) = Validators::validateEntityName($input->getOption('user_entity'));
+                $this->userEntityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($userBundle).'\\'.$userEntity;
             } else {
                 list($userBundle, $userEntity) = $this->getHelperSet()->get('dialog')->askAndValidate($output, 'Please enter the User Entity shortcut name: ', 'Sonata\AdminBundle\Command\Validators::validateEntityName');
 
                 // Entity exists?
-               $this->userEntityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($userBundle).'\\'.$userEntity;
+                $this->userEntityClass = $this->getContainer()->get('doctrine')->getEntityNamespace($userBundle).'\\'.$userEntity;
             }
         }
 

+ 13 - 6
Controller/CRUDController.php

@@ -244,8 +244,11 @@ class CRUDController extends Controller
 
                 $this->addFlash(
                     'sonata_flash_success',
-                    $this->admin->trans('flash_delete_success', array('%name%' => $this->admin->toString($object)),
-                    'SonataAdminBundle')
+                    $this->admin->trans(
+                        'flash_delete_success',
+                        array('%name%' => $this->admin->toString($object)),
+                        'SonataAdminBundle'
+                    )
                 );
 
             } catch (ModelManagerException $e) {
@@ -256,8 +259,11 @@ class CRUDController extends Controller
 
                 $this->addFlash(
                     'sonata_flash_error',
-                    $this->admin->trans('flash_delete_error', array('%name%' => $this->admin->toString($object)),
-                    'SonataAdminBundle')
+                    $this->admin->trans(
+                        'flash_delete_error',
+                        array('%name%' => $this->admin->toString($object)),
+                        'SonataAdminBundle'
+                    )
                 );
             }
 
@@ -736,11 +742,12 @@ class CRUDController extends Controller
 
         $allowedExportFormats = (array) $this->admin->getExportFormats();
 
-        if (!in_array($format, $allowedExportFormats) ) {
+        if (!in_array($format, $allowedExportFormats)) {
             throw new \RuntimeException(sprintf('Export in format `%s` is not allowed for class: `%s`. Allowed formats are: `%s`', $format, $this->admin->getClass(), implode(', ', $allowedExportFormats)));
         }
 
-        $filename = sprintf('export_%s_%s.%s',
+        $filename = sprintf(
+            'export_%s_%s.%s',
             strtolower(substr($this->admin->getClass(), strripos($this->admin->getClass(), '\\') + 1)),
             date('Y_m_d_H_i_s', strtotime('now')),
             $format

+ 1 - 1
Datagrid/DatagridMapper.php

@@ -56,7 +56,7 @@ class DatagridMapper extends BaseMapper
             $filterOptions['field_type'] = $fieldType;
         }
 
-        $filterOptions['field_name'] = isset($filterOptions['field_name']) ? $filterOptions['field_name'] : substr(strrchr('.'.$name,'.'), 1);
+        $filterOptions['field_name'] = isset($filterOptions['field_name']) ? $filterOptions['field_name'] : substr(strrchr('.'.$name, '.'), 1);
 
         if ($name instanceof FieldDescriptionInterface) {
             $fieldDescription = $name;

+ 2 - 2
Event/PersistenceEvent.php

@@ -21,8 +21,8 @@ use Symfony\Component\EventDispatcher\Event;
  *   - preRemove | postRemove
  *
  * You can register the listener to the event dispatcher by using:
- *   - sonata.admin.event.persitence.[pre|post]_[persist|update|remove)
- *   - sonata.admin.event.persitence.[admin_code].[pre|post]_[persist|update|remove)  (not implemented yet)
+ *   - sonata.admin.event.persistence.[pre|post]_[persist|update|remove)
+ *   - sonata.admin.event.persistence.[admin_code].[pre|post]_[persist|update|remove)  (not implemented yet)
  *
  */
 class PersistenceEvent extends Event

+ 1 - 0
Filter/FilterInterface.php

@@ -10,6 +10,7 @@
  */
 
 namespace Sonata\AdminBundle\Filter;
+
 use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
 
 interface FilterInterface

+ 3 - 3
Mapper/BaseGroupedMapper.php

@@ -66,9 +66,9 @@ abstract class BaseGroupedMapper extends BaseMapper
      * 
      * @param string $fieldName
      */
-    protected function addFieldToCurrentGroup($fieldName) 
+    protected function addFieldToCurrentGroup($fieldName)
     {
-        // Note this line must happen before the next line. 
+        // Note this line must happen before the next line.
         // See https://github.com/sonata-project/SonataAdminBundle/pull/1351
         $currentGroup = $this->getCurrentGroupName();
         $groups = $this->getGroups();
@@ -87,7 +87,7 @@ abstract class BaseGroupedMapper extends BaseMapper
      * 
      * @return string
      */
-    protected function getCurrentGroupName() 
+    protected function getCurrentGroupName()
     {
         if (!$this->currentGroup) {
             $this->with($this->admin->getLabel());

+ 2 - 2
Tests/Command/ValidatorsTest.php

@@ -216,14 +216,14 @@ class ValidatorsTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
-     * @dataProvider getValidateServicesFiletTests
+     * @dataProvider getValidateServicesFileTests
      */
     public function testValidateServicesFile($expected, $value)
     {
         $this->assertEquals($expected, Validators::validateServicesFile($value));
     }
 
-    public function getValidateServicesFiletTests()
+    public function getValidateServicesFileTests()
     {
         return array(
             array('foobar', 'foobar'),

+ 1 - 1
Tests/Controller/CRUDControllerTest.php

@@ -2362,7 +2362,7 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $args = func_get_args();
 
         // creates equalTo of all arguments passed to this function
-        $phpunit = $this; // PHP 5.3 compatiblity
+        $phpunit = $this; // PHP 5.3 compatibility
         $argsCheck = array_map(function($item) use ($phpunit) {
             return $phpunit->equalTo($item);
         }, func_get_args());

+ 1 - 1
Tests/Controller/HelperControllerTest.php

@@ -93,7 +93,7 @@ class HelperControllerTest extends \PHPUnit_Framework_TestCase
 
     /**
      * @expectedException \RuntimeException
-     * @expectionMessage Invalid format
+     * @exceptionMessage Invalid format
      */
     public function testgetShortObjectDescriptionActionObjectDoesNotExist()
     {

+ 2 - 2
Tests/Form/Type/ModelTypeTest.php

@@ -46,7 +46,7 @@ class ModelTypeTest extends TypeTestCase
     }
 
     /**
-     * @dataProvider getCompundOptionTests
+     * @dataProvider getCompoundOptionTests
      */
     public function testCompundOption($expectedCompound, $multiple, $expanded)
     {
@@ -75,7 +75,7 @@ class ModelTypeTest extends TypeTestCase
         $this->assertInstanceOf('Sonata\AdminBundle\Form\ChoiceList\ModelChoiceList', $options['choice_list']);
     }
 
-    public function getCompundOptionTests()
+    public function getCompoundOptionTests()
     {
         return array(
             array(true, true, true), //checkboxes

+ 7 - 7
Tests/Route/AdminPoolLoaderTest.php

@@ -36,22 +36,22 @@ class AdminPoolLoaderTest extends \PHPUnit_Framework_TestCase
 
         $adminPoolLoader = new AdminPoolLoader($pool, array('foo_admin', 'bar_admin'), $container);
 
-        $roureCollection1 = new RouteCollection('base.Code.Route.foo', 'baseRouteNameFoo', 'baseRoutePatternFoo', 'baseControllerNameFoo');
-        $roureCollection2 = new RouteCollection('base.Code.Route.bar', 'baseRouteNameBar', 'baseRoutePatternBar', 'baseControllerNameBar');
+        $routeCollection1 = new RouteCollection('base.Code.Route.foo', 'baseRouteNameFoo', 'baseRoutePatternFoo', 'baseControllerNameFoo');
+        $routeCollection2 = new RouteCollection('base.Code.Route.bar', 'baseRouteNameBar', 'baseRoutePatternBar', 'baseControllerNameBar');
 
-        $roureCollection1->add('foo');
-        $roureCollection2->add('bar');
-        $roureCollection2->add('baz');
+        $routeCollection1->add('foo');
+        $routeCollection2->add('bar');
+        $routeCollection2->add('baz');
 
         $admin1 = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
         $admin1->expects($this->once())
             ->method('getRoutes')
-            ->will($this->returnValue($roureCollection1));
+            ->will($this->returnValue($routeCollection1));
 
         $admin2 = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface');
         $admin2->expects($this->once())
             ->method('getRoutes')
-            ->will($this->returnValue($roureCollection2));
+            ->will($this->returnValue($routeCollection2));
 
         $pool->expects($this->any())
             ->method('getInstance')

+ 3 - 3
Tests/Twig/Extension/SonataAdminExtensionTest.php

@@ -617,16 +617,16 @@ class SonataAdminExtensionTest extends \PHPUnit_Framework_TestCase
 
     public function testGetUrlsafeIdentifier()
     {
-        $enitity = new \stdClass();
+        $entity = new \stdClass();
 
         // set admin to pool
         $this->pool->setAdminClasses(array('stdClass'=> array('sonata_admin_foo_service')));
 
         $this->admin->expects($this->once())
             ->method('getUrlsafeIdentifier')
-            ->with($this->equalTo($enitity))
+            ->with($this->equalTo($entity))
             ->will($this->returnValue(1234567));
 
-        $this->assertEquals(1234567, $this->twigExtension->getUrlsafeIdentifier($enitity));
+        $this->assertEquals(1234567, $this->twigExtension->getUrlsafeIdentifier($entity));
     }
 }