From 05d850fc15a305d4e3d407326864ed72469c397e Mon Sep 17 00:00:00 2001 From: Jordi Date: Mon, 10 Aug 2020 19:25:22 +0200 Subject: [PATCH] first round of review --- src/Admin/AbstractAdmin.php | 2 ++ src/Admin/AdminInterface.php | 3 +++ src/Mapper/BaseMapper.php | 9 +++++++-- src/Show/ShowMapper.php | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) 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..58013f3b947 100644 --- a/src/Show/ShowMapper.php +++ b/src/Show/ShowMapper.php @@ -107,7 +107,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 +160,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);