Skip to content

Commit

Permalink
Minor CS and doc fixes, declared missing properties, fixed deprecated…
Browse files Browse the repository at this point in the history
… logger->err calls

Fixed Tests namespaces

CS fix

Fix minor doc issues in interfaces
  • Loading branch information
pulzarraider committed Jan 2, 2015
1 parent c7d545d commit cc0181e
Show file tree
Hide file tree
Showing 68 changed files with 144 additions and 217 deletions.
21 changes: 10 additions & 11 deletions Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Route\RoutesCache;
use Sonata\CoreBundle\Model\Metadata;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormBuilder;
Expand All @@ -28,7 +27,6 @@
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Show\ShowMapper;

use Sonata\AdminBundle\Admin\Pool;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Validator\Constraints\InlineConstraint;

Expand Down Expand Up @@ -264,7 +262,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
/**
* Reference the parent collection
*
* @var Admin
* @var AdminInterface|null
*/
protected $parent = null;

Expand Down Expand Up @@ -541,7 +539,7 @@ protected function configureSideMenu(MenuItemInterface $menu, $action, AdminInte
* Configures the tab menu in your admin
*
* @param MenuItemInterface $menu
* @param $action
* @param string $action
* @param AdminInterface $childAdmin
*
* @return mixed
Expand Down Expand Up @@ -1355,7 +1353,7 @@ protected function attachInlineValidator()

$metadata->addConstraint(new InlineConstraint(array(
'service' => $this,
'method' => function(ErrorElement $errorElement, $object) use ($admin) {
'method' => function (ErrorElement $errorElement, $object) use ($admin) {
/* @var \Sonata\AdminBundle\Admin\AdminInterface $admin */

// This avoid the main validation to be cascaded to children
Expand Down Expand Up @@ -2101,6 +2099,7 @@ public function getBreadcrumbs($action)

$breadcrumbs = array_reverse($breadcrumbs);
array_shift($breadcrumbs);

return $breadcrumbs;
}

Expand Down Expand Up @@ -2216,13 +2215,13 @@ public function trans($id, array $parameters = array(), $domain = null, $locale
}

/**
* translate a message id
* Translate a message id
*
* @param string $id
* @param integer $count
* @param array $parameters
* @param null $domain
* @param null $locale
* @param string $id
* @param integer $count
* @param array $parameters
* @param string|null $domain
* @param string|null $locale
*
* @return string the translated string
*/
Expand Down
1 change: 0 additions & 1 deletion Admin/AdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

use Knp\Menu\ItemInterface as MenuItemInterface;
Expand Down
1 change: 0 additions & 1 deletion Admin/AdminExtensionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;

use Knp\Menu\ItemInterface as MenuItemInterface;
Expand Down
1 change: 0 additions & 1 deletion Admin/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Sonata\AdminBundle\Exception\NoValueException;
use Sonata\AdminBundle\Util\FormViewIterator;
use Sonata\AdminBundle\Util\FormBuilderIterator;
use Sonata\AdminBundle\Admin\BaseFieldDescription;

class AdminHelper
{
Expand Down
13 changes: 5 additions & 8 deletions Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Admin\Pool;
use Sonata\AdminBundle\Admin\FieldDescriptionInterface;
use Sonata\AdminBundle\Builder\FormContractorInterface;
use Sonata\AdminBundle\Builder\ListBuilderInterface;
use Sonata\AdminBundle\Builder\DatagridBuilderInterface;
Expand All @@ -24,7 +22,6 @@
use Sonata\AdminBundle\Route\RouteGeneratorInterface;

use Knp\Menu\FactoryInterface as MenuFactoryInterface;
use Knp\Menu\ItemInterface as MenuItemInterface;

use Sonata\CoreBundle\Model\Metadata;
use Symfony\Component\Validator\ValidatorInterface;
Expand Down Expand Up @@ -180,7 +177,7 @@ public function generateUrl($name, array $parameters = array(), $absolute = fals
public function generateMenuUrl($name, array $parameters = array(), $absolute = false);

/**
* @return \Sonata\AdminBundle\Model\ModelManagerInterface;
* @return \Sonata\AdminBundle\Model\ModelManagerInterface
*/
public function getModelManager();

Expand Down Expand Up @@ -233,7 +230,7 @@ public function getRequest();

/**
* @return boolean true if a request object is linked to this Admin, false
* otherwise.
* otherwise.
*/
public function hasRequest();

Expand Down Expand Up @@ -570,7 +567,7 @@ public function getChildren();
*
* @param string $code
*
* @return array|null
* @return AdminInterface|null
*/
public function getChild($code);

Expand Down Expand Up @@ -601,7 +598,7 @@ public function getUniqid();
public function getObject($id);

/**
* @param string $subject
* @param object $subject
*
* @return mixed
*/
Expand Down Expand Up @@ -850,7 +847,7 @@ public function setShowTabs(array $showTabs);
/**
* Remove a form group field
*
* @param $key
* @param string $key
*
* @return void
*/
Expand Down
12 changes: 4 additions & 8 deletions Admin/BaseFieldDescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Exception\NoValueException;
use Symfony\Component\DependencyInjection\Container;

Expand Down Expand Up @@ -106,17 +105,17 @@ abstract class BaseFieldDescription implements FieldDescriptionInterface
protected $options = array();

/**
* @var Admin|null the parent Admin instance
* @var AdminInterface|null the parent Admin instance
*/
protected $parent = null;

/**
* @var Admin the related admin instance
* @var AdminInterface the related admin instance
*/
protected $admin;

/**
* @var Admin the associated admin class if the object is associated to another entity
* @var AdminInterface the associated admin class if the object is associated to another entity
*/
protected $associationAdmin;

Expand Down Expand Up @@ -293,9 +292,6 @@ public function getParentAssociationMappings()
}

/**
* set the association admin instance (only used if the field is linked to an Admin)
*
* @param \Sonata\AdminBundle\Admin\AdminInterface $associationAdmin the associated admin
* {@inheritdoc}
*/
public function setAssociationAdmin(AdminInterface $associationAdmin)
Expand Down Expand Up @@ -479,6 +475,6 @@ public function getSortParentAssociationMapping()
*/
public function getTranslationDomain()
{
return $this->getOption('translation_domain') ? : $this->getAdmin()->getTranslationDomain();
return $this->getOption('translation_domain') ?: $this->getAdmin()->getTranslationDomain();
}
}
2 changes: 0 additions & 2 deletions Admin/FieldDescriptionCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/
namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Admin\FieldDescriptionInterface;

class FieldDescriptionCollection implements \ArrayAccess, \Countable
{
protected $elements = array();
Expand Down
2 changes: 0 additions & 2 deletions Admin/FieldDescriptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Sonata\AdminBundle\Admin;

use Sonata\AdminBundle\Admin\AdminInterface;

interface FieldDescriptionInterface
{

Expand Down
2 changes: 1 addition & 1 deletion Admin/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function getInstance($id)
}

/**
* @return null|\Symfony\Component\DependencyInjection\ContainerInterface
* @return ContainerInterface|null
*/
public function getContainer()
{
Expand Down
3 changes: 0 additions & 3 deletions Block/AdminListBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
use Sonata\BlockBundle\Block\BlockContextInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;

use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Admin\Pool;

use Sonata\BlockBundle\Model\BlockInterface;
use Sonata\BlockBundle\Block\BaseBlockService;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
Expand Down
2 changes: 0 additions & 2 deletions Builder/FormContractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
namespace Sonata\AdminBundle\Builder;

use Sonata\AdminBundle\Admin\FieldDescriptionInterface;
use Sonata\AdminBundle\Admin\AdminInterface;

use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormFactoryInterface;

Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/ExtensionCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function process(ContainerBuilder $container)
protected function getExtensionsForAdmin($id, Definition $admin, ContainerBuilder $container, array $extensionMap)
{
$extensions = array();
$class = $classReflection = $subjectReflection = null;
$classReflection = $subjectReflection = null;

$excludes = $extensionMap['excludes'];
unset($extensionMap['excludes']);
Expand Down
1 change: 0 additions & 1 deletion Export/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Sonata\AdminBundle\Export;

use Symfony\Component\HttpFoundation\StreamedResponse;
use Sonata\CoreBundle\Exporter\Exporter as BaseExporter;

/**
Expand Down
2 changes: 0 additions & 2 deletions Filter/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Sonata\AdminBundle\Filter;

use Sonata\AdminBundle\Filter\FilterInterface;

abstract class Filter implements FilterInterface
{
protected $name = null;
Expand Down
8 changes: 4 additions & 4 deletions Form/ChoiceList/ModelChoiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ public function getEntities()
* If they have single identifiers, they are either fetched from the
* internal entity cache (if filled) or loaded from the database.
*
* @param string $key The choice key (for entities with composite
* identifiers) or entity ID (for entities with single
* identifiers)
* @param string $key The choice key (for entities with composite
* identifiers) or entity ID (for entities with single
* identifiers)
* @return object The matching entity
*/
public function getEntity($key)
Expand Down Expand Up @@ -241,7 +241,7 @@ private function getReflProperty($property)
*
* @param object $entity The entity for which to get the identifier
* @throws InvalidArgumentException If the entity does not exist in Doctrine's
* identity map
* identity map
* @return array
*/
public function getIdentifierValues($entity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public function getExtendedType()
{
return 'form';
}
}
}
1 change: 0 additions & 1 deletion Form/Type/AdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;

use Symfony\Component\Form\ReversedTransformer;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

Expand Down
8 changes: 4 additions & 4 deletions Generator/AdminGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AdminGenerator extends Generator

/**
* @param ModelManagerInterface $modelManager
* @param array|string $skeletonDirectories
* @param array|string $skeletonDirectories
*/
public function __construct(ModelManagerInterface $modelManager, $skeletonDirectories)
{
Expand All @@ -42,9 +42,9 @@ public function __construct(ModelManagerInterface $modelManager, $skeletonDirect
}

/**
* @param BundleInterface $bundle
* @param string $adminClassBasename
* @param string $modelClass
* @param BundleInterface $bundle
* @param string $adminClassBasename
* @param string $modelClass
* @throws \RuntimeException
*/
public function generate(BundleInterface $bundle, $adminClassBasename, $modelClass)
Expand Down
4 changes: 2 additions & 2 deletions Generator/ControllerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function __construct($skeletonDirectory)
}

/**
* @param BundleInterface $bundle
* @param string $controllerClassBasename
* @param BundleInterface $bundle
* @param string $controllerClassBasename
* @throws \RuntimeException
*/
public function generate(BundleInterface $bundle, $controllerClassBasename)
Expand Down
3 changes: 1 addition & 2 deletions Guesser/TypeGuesserChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace Sonata\AdminBundle\Guesser;

use Sonata\AdminBundle\Guesser\TypeGuesserInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Guess\Guess;
use Sonata\AdminBundle\Model\ModelManagerInterface;
Expand Down Expand Up @@ -61,7 +60,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager
* return values
*
* @param \Closure $closure The closure to execute. Accepts a guesser
* as argument and should return a Guess instance
* as argument and should return a Guess instance
*
* @return Guess The guess with the highest confidence
*/
Expand Down
12 changes: 5 additions & 7 deletions Manipulator/ServicesManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

namespace Sonata\AdminBundle\Manipulator;

use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Yaml\Yaml;

/**
Expand Down Expand Up @@ -42,11 +40,11 @@ public function __construct($file)
}

/**
* @param string $serviceId
* @param string $modelClass
* @param string $adminClass
* @param string $controllerName
* @param string $managerType
* @param string $serviceId
* @param string $modelClass
* @param string $adminClass
* @param string $controllerName
* @param string $managerType
* @throws \RuntimeException
*/
public function addResource($serviceId, $modelClass, $adminClass, $controllerName, $managerType)
Expand Down
Loading

0 comments on commit cc0181e

Please sign in to comment.