Skip to content

Commit

Permalink
PHP CS Fixer apply
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed Jun 14, 2015
1 parent b0b75b6 commit 11679cb
Show file tree
Hide file tree
Showing 191 changed files with 1,664 additions and 1,975 deletions.
283 changes: 131 additions & 152 deletions Admin/Admin.php

Large diffs are not rendered by default.

63 changes: 39 additions & 24 deletions Admin/AdminExtension.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of the Sonata package.
*
Expand All @@ -10,20 +11,18 @@

namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\CoreBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

use Knp\Menu\ItemInterface as MenuItemInterface;

/**
* Class AdminExtension
* Class AdminExtension.
*
* @package Sonata\AdminBundle\Admin
* @author Thomas Rabaix <[email protected]>
*/
abstract class AdminExtension implements AdminExtensionInterface
Expand All @@ -32,37 +31,43 @@ abstract class AdminExtension implements AdminExtensionInterface
* {@inheritdoc}
*/
public function configureFormFields(FormMapper $form)
{}
{
}

/**
* {@inheritdoc}
*/
public function configureListFields(ListMapper $list)
{}
{
}

/**
* {@inheritdoc}
*/
public function configureDatagridFilters(DatagridMapper $filter)
{}
{
}

/**
* {@inheritdoc}
*/
public function configureShowFields(ShowMapper $show)
{}
{
}

/**
* {@inheritdoc}
*/
public function configureRoutes(AdminInterface $admin, RouteCollection $collection)
{}
{
}

/**
* {@inheritdoc}
*/
public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
{}
{
}

/**
* {@inheritdoc}
Expand All @@ -78,25 +83,29 @@ public function configureTabMenu(AdminInterface $admin, MenuItemInterface $menu,
* {@inheritdoc}
*/
public function validate(AdminInterface $admin, ErrorElement $errorElement, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query, $context = 'list')
{}
{
}

/**
* {@inheritdoc}
*/
public function alterNewInstance(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function alterObject(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
Expand All @@ -110,35 +119,41 @@ public function getPersistentParameters(AdminInterface $admin)
* {@inheritdoc}
*/
public function preUpdate(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function postUpdate(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function prePersist(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function postPersist(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function preRemove(AdminInterface $admin, $object)
{}
{
}

/**
* {@inheritdoc}
*/
public function postRemove(AdminInterface $admin, $object)
{}
{
}
}
28 changes: 14 additions & 14 deletions Admin/AdminExtensionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@

namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\CoreBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

use Knp\Menu\ItemInterface as MenuItemInterface;

/**
* Interface AdminExtensionInterface
* Interface AdminExtensionInterface.
*
* @package Sonata\AdminBundle\Admin
* @author Thomas Rabaix <[email protected]>
*/
interface AdminExtensionInterface
Expand Down Expand Up @@ -56,7 +54,7 @@ public function configureShowFields(ShowMapper $show);
public function configureRoutes(AdminInterface $admin, RouteCollection $collection);

/**
* DEPRECATED: Use configureTabMenu instead
* DEPRECATED: Use configureTabMenu instead.
*
* @param AdminInterface $admin
* @param MenuItemInterface $menu
Expand All @@ -70,7 +68,7 @@ public function configureRoutes(AdminInterface $admin, RouteCollection $collecti
public function configureSideMenu(AdminInterface $admin, MenuItemInterface $menu, $action, AdminInterface $childAdmin = null);

/**
* Builds the tab menu
* Builds the tab menu.
*
* @param AdminInterface $admin
* @param MenuItemInterface $menu
Expand Down Expand Up @@ -106,18 +104,20 @@ public function configureQuery(AdminInterface $admin, ProxyQueryInterface $query
public function alterNewInstance(AdminInterface $admin, $object);

/**
* Get a chance to modify object instance
* Get a chance to modify object instance.
*
* @param AdminInterface $admin
* @param AdminInterface $admin
* @param $object
*
* @return mixed
*/
public function alterObject(AdminInterface $admin, $object);

/**
* Get a chance to add persistent parameters
* Get a chance to add persistent parameters.
*
* @param AdminInterface $admin
*
* @param AdminInterface $admin
* @return array
*/
public function getPersistentParameters(AdminInterface $admin);
Expand Down
21 changes: 10 additions & 11 deletions Admin/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@

use Doctrine\Common\Inflector\Inflector;
use Doctrine\Common\Util\ClassUtils;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormView;
use Sonata\AdminBundle\Exception\NoValueException;
use Sonata\AdminBundle\Util\FormViewIterator;
use Sonata\AdminBundle\Util\FormBuilderIterator;
use Sonata\AdminBundle\Util\FormViewIterator;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormView;

/**
* Class AdminHelper
* Class AdminHelper.
*
* @package Sonata\AdminBundle\Admin
* @author Thomas Rabaix <[email protected]>
*/
class AdminHelper
Expand Down Expand Up @@ -53,7 +52,7 @@ public function getChildFormBuilder(FormBuilderInterface $formBuilder, $elementI
}
}

return null;
return;
}

/**
Expand All @@ -70,7 +69,7 @@ public function getChildFormView(FormView $formView, $elementId)
}
}

return null;
return;
}

/**
Expand All @@ -89,7 +88,7 @@ public function getAdmin($code)
* Note:
* This code is ugly, but there is no better way of doing it.
* For now the append form element action used to add a new row works
* only for direct FieldDescription (not nested one)
* only for direct FieldDescription (not nested one).
*
* @throws \RuntimeException
*
Expand Down Expand Up @@ -142,7 +141,7 @@ public function appendFormFieldElement(AdminInterface $admin, $subject, $element
while ($objectCount < $postCount) {
// append a new instance into the object
$this->addNewInstance($form->getData(), $fieldDescription);
$objectCount++;
++$objectCount;
}

$this->addNewInstance($form->getData(), $fieldDescription);
Expand All @@ -157,7 +156,7 @@ public function appendFormFieldElement(AdminInterface $admin, $subject, $element
}

/**
* Add a new instance to the related FieldDescriptionInterface value
* Add a new instance to the related FieldDescriptionInterface value.
*
* @param object $object
* @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
Expand Down Expand Up @@ -187,7 +186,7 @@ public function addNewInstance($object, FieldDescriptionInterface $fieldDescript
}

/**
* Camelize a string
* Camelize a string.
*
* @static
*
Expand Down
Loading

0 comments on commit 11679cb

Please sign in to comment.