diff --git a/src/Admin/AbstractAdmin.php b/src/Admin/AbstractAdmin.php index 9a8fd654c8c..5772399e3a7 100644 --- a/src/Admin/AbstractAdmin.php +++ b/src/Admin/AbstractAdmin.php @@ -1749,6 +1749,8 @@ public function isCurrentChild(): bool /** * Returns the current child admin instance. + * + * @return AdminInterface|null the current child admin instance */ public function getCurrentChildAdmin(): ?AdminInterface { diff --git a/src/Admin/AdminInterface.php b/src/Admin/AdminInterface.php index 98c568e6fcd..db61a3f3176 100644 --- a/src/Admin/AdminInterface.php +++ b/src/Admin/AdminInterface.php @@ -135,6 +135,9 @@ public function getSecurityInformation(): array; public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription): void; + /** + * @throws \LogicException + */ public function getParentFieldDescription(): FieldDescriptionInterface; /** diff --git a/src/Mapper/BaseMapper.php b/src/Mapper/BaseMapper.php index 88f1b5303e2..b00020ec98e 100644 --- a/src/Mapper/BaseMapper.php +++ b/src/Mapper/BaseMapper.php @@ -51,7 +51,10 @@ abstract public function get(string $key); abstract public function has(string $key): bool; - abstract public function remove(string $key): self; + /** + * @return static + */ + abstract public function remove(string $key); /** * Returns configured keys. @@ -62,6 +65,8 @@ abstract public function keys(): array; /** * @param string[] $keys field names + * + * @return static */ - abstract public function reorder(array $keys): self; + abstract public function reorder(array $keys); } diff --git a/src/Show/ShowMapper.php b/src/Show/ShowMapper.php index 7a3d4d08b4e..f8d40acdb1c 100644 --- a/src/Show/ShowMapper.php +++ b/src/Show/ShowMapper.php @@ -18,7 +18,6 @@ use Sonata\AdminBundle\Admin\FieldDescriptionInterface; use Sonata\AdminBundle\Builder\ShowBuilderInterface; use Sonata\AdminBundle\Mapper\BaseGroupedMapper; -use Sonata\AdminBundle\Mapper\BaseMapper; /** * This class is used to simulate the Form API. @@ -107,7 +106,7 @@ public function has(string $key): bool return $this->list->has($key); } - public function remove(string $key): BaseMapper + public function remove(string $key): self { $this->admin->removeShowFieldDescription($key); $this->list->remove($key); @@ -160,7 +159,7 @@ final public function keys(): array return array_keys($this->list->getElements()); } - public function reorder(array $keys): BaseMapper + public function reorder(array $keys): self { $this->admin->reorderShowGroup($this->getCurrentGroupName(), $keys);