Browse Source

Provide more accurate phpdoc

Grégoire Paris 8 years ago
parent
commit
54ea62638a

+ 1 - 1
Admin/AbstractAdmin.php

@@ -1433,7 +1433,7 @@ abstract class AbstractAdmin implements AdminInterface, DomainObjectInterface
     /**
     /**
      * Returns the master admin.
      * Returns the master admin.
      *
      *
-     * @return Admin the root admin class
+     * @return AbstractAdmin the root admin class
      */
      */
     public function getRoot()
     public function getRoot()
     {
     {

+ 1 - 1
Admin/AdminHelper.php

@@ -46,7 +46,7 @@ class AdminHelper
      * @param FormBuilderInterface $formBuilder
      * @param FormBuilderInterface $formBuilder
      * @param string               $elementId
      * @param string               $elementId
      *
      *
-     * @return FormBuilderInterface
+     * @return FormBuilderInterface|null
      */
      */
     public function getChildFormBuilder(FormBuilderInterface $formBuilder, $elementId)
     public function getChildFormBuilder(FormBuilderInterface $formBuilder, $elementId)
     {
     {

+ 1 - 1
Admin/AdminInterface.php

@@ -403,7 +403,7 @@ interface AdminInterface
      *
      *
      * @param string $name
      * @param string $name
      *
      *
-     * @return array|null
+     * @return FieldDescriptionInterface|null
      */
      */
     public function getFilterFieldDescription($name);
     public function getFilterFieldDescription($name);
 
 

+ 1 - 1
Admin/Pool.php

@@ -214,7 +214,7 @@ class Pool
      *
      *
      * @param string $adminCode
      * @param string $adminCode
      *
      *
-     * @return \Sonata\AdminBundle\Admin\AdminInterface|null
+     * @return \Sonata\AdminBundle\Admin\AdminInterface|false|null
      */
      */
     public function getAdminByAdminCode($adminCode)
     public function getAdminByAdminCode($adminCode)
     {
     {

+ 2 - 3
Controller/HelperController.php

@@ -16,7 +16,6 @@ use Sonata\AdminBundle\Admin\AdminInterface;
 use Sonata\AdminBundle\Admin\Pool;
 use Sonata\AdminBundle\Admin\Pool;
 use Sonata\AdminBundle\Filter\FilterInterface;
 use Sonata\AdminBundle\Filter\FilterInterface;
 use Symfony\Bridge\Twig\Form\TwigRenderer;
 use Symfony\Bridge\Twig\Form\TwigRenderer;
-use Symfony\Component\Form\FormInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\Response;
@@ -444,7 +443,7 @@ class HelperController
      * @param AdminInterface $admin
      * @param AdminInterface $admin
      * @param string         $field
      * @param string         $field
      *
      *
-     * @return FormInterface
+     * @return \Sonata\AdminBundle\Admin\FieldDescriptionInterface
      *
      *
      * @throws \RuntimeException
      * @throws \RuntimeException
      */
      */
@@ -471,7 +470,7 @@ class HelperController
      * @param AdminInterface $admin
      * @param AdminInterface $admin
      * @param string         $field
      * @param string         $field
      *
      *
-     * @return FormInterface
+     * @return \Sonata\AdminBundle\Admin\FieldDescriptionInterface
      *
      *
      * @throws \RuntimeException
      * @throws \RuntimeException
      */
      */

+ 2 - 2
Datagrid/Pager.php

@@ -56,7 +56,7 @@ abstract class Pager implements \Iterator, \Countable, \Serializable, PagerInter
     protected $currentMaxLink = 1;
     protected $currentMaxLink = 1;
 
 
     /**
     /**
-     * @var bool
+     * @var mixed bool|int
      */
      */
     protected $maxRecordLimit = false;
     protected $maxRecordLimit = false;
 
 
@@ -67,7 +67,7 @@ abstract class Pager implements \Iterator, \Countable, \Serializable, PagerInter
 
 
     // used by iterator interface
     // used by iterator interface
     /**
     /**
-     * @var array|null
+     * @var \Traversable|array|null
      */
      */
     protected $results = null;
     protected $results = null;
 
 

+ 1 - 1
Form/DataTransformer/ModelToIdPropertyTransformer.php

@@ -43,7 +43,7 @@ class ModelToIdPropertyTransformer implements DataTransformerInterface
     protected $multiple;
     protected $multiple;
 
 
     /**
     /**
-     * @var callback
+     * @var callable|null
      */
      */
     protected $toStringCallback;
     protected $toStringCallback;
 
 

+ 3 - 3
Mapper/BaseGroupedMapper.php

@@ -19,17 +19,17 @@ namespace Sonata\AdminBundle\Mapper;
 abstract class BaseGroupedMapper extends BaseMapper
 abstract class BaseGroupedMapper extends BaseMapper
 {
 {
     /**
     /**
-     * @var string
+     * @var string|null
      */
      */
     protected $currentGroup;
     protected $currentGroup;
 
 
     /**
     /**
-     * @var string
+     * @var string|null
      */
      */
     protected $currentTab;
     protected $currentTab;
 
 
     /**
     /**
-     * @var bool
+     * @var bool|null
      */
      */
     protected $apply;
     protected $apply;
 
 

+ 1 - 1
Search/SearchHandler.php

@@ -40,7 +40,7 @@ class SearchHandler
      * @param int            $page
      * @param int            $page
      * @param int            $offset
      * @param int            $offset
      *
      *
-     * @return PagerInterface
+     * @return PagerInterface|false
      *
      *
      * @throws \RuntimeException
      * @throws \RuntimeException
      */
      */

+ 1 - 1
Twig/Extension/SonataAdminExtension.php

@@ -447,7 +447,7 @@ EOT;
      * @param FieldDescriptionInterface $fieldDescription
      * @param FieldDescriptionInterface $fieldDescription
      * @param string                    $defaultTemplate
      * @param string                    $defaultTemplate
      *
      *
-     * @return \Twig_Template
+     * @return \Twig_TemplateInterface
      */
      */
     protected function getTemplate(
     protected function getTemplate(
         FieldDescriptionInterface $fieldDescription,
         FieldDescriptionInterface $fieldDescription,