Skip to content

Commit

Permalink
CS apply
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed Jul 24, 2015
1 parent 44ea2d8 commit e723524
Show file tree
Hide file tree
Showing 196 changed files with 1,993 additions and 2,283 deletions.
337 changes: 153 additions & 184 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,6 +1,7 @@
<?php

/*
* This file is part of the Sonata package.
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
Expand All @@ -10,54 +11,58 @@

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\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

use Knp\Menu\ItemInterface as MenuItemInterface;

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 $filter)
{}
{
}

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

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

/**
* {@inheritdoc}
Expand All @@ -73,25 +78,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 @@ -105,35 +114,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)
{}
{
}
}
29 changes: 15 additions & 14 deletions Admin/AdminExtensionInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/*
* This file is part of the Sonata package.
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
Expand All @@ -10,16 +11,14 @@

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\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

use Knp\Menu\ItemInterface as MenuItemInterface;

/**
*
Expand Down Expand Up @@ -53,7 +52,7 @@ public function configureShowFields(ShowMapper $filter);
public function configureRoutes(AdminInterface $admin, RouteCollection $collection);

/**
* DEPRECATED: Use configureTabMenu instead
* DEPRECATED: Use configureTabMenu instead.
*
* @param AdminInterface $admin
* @param MenuItemInterface $menu
Expand All @@ -67,7 +66,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 @@ -103,18 +102,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
22 changes: 11 additions & 11 deletions Admin/AdminHelper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/*
* This file is part of the Sonata package.
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
Expand All @@ -12,12 +13,11 @@

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

class AdminHelper
{
Expand Down Expand Up @@ -47,7 +47,7 @@ public function getChildFormBuilder(FormBuilder $formBuilder, $elementId)
}
}

return null;
return;
}

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

return null;
return;
}

/**
Expand All @@ -83,7 +83,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 @@ -136,7 +136,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 @@ -152,7 +152,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 @@ -182,7 +182,7 @@ public function addNewInstance($object, FieldDescriptionInterface $fieldDescript
}

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

0 comments on commit e723524

Please sign in to comment.