Skip to content

Commit

Permalink
first round of review
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Aug 10, 2020
1 parent 7baaa6e commit bd85adf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Admin/AbstractAdmin.php
Expand Up @@ -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
{
Expand Down
3 changes: 3 additions & 0 deletions src/Admin/AdminInterface.php
Expand Up @@ -135,6 +135,9 @@ public function getSecurityInformation(): array;

public function setParentFieldDescription(FieldDescriptionInterface $parentFieldDescription): void;

/**
* @throws \LogicException
*/
public function getParentFieldDescription(): FieldDescriptionInterface;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Datagrid/DatagridMapper.php
Expand Up @@ -118,15 +118,15 @@ final public function keys(): array
return array_keys($this->datagrid->getFilters());
}

public function remove(string $key): BaseMapper
public function remove(string $key): self
{
$this->admin->removeFilterFieldDescription($key);
$this->datagrid->removeFilter($key);

return $this;
}

public function reorder(array $keys): BaseMapper
public function reorder(array $keys): self
{
$this->datagrid->reorderFilters($keys);

Expand Down
7 changes: 6 additions & 1 deletion src/Mapper/BaseMapper.php
Expand Up @@ -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.
Expand All @@ -62,6 +65,8 @@ abstract public function keys(): array;

/**
* @param string[] $keys field names
*
* @return static
*/
abstract public function reorder(array $keys): self;
}

0 comments on commit bd85adf

Please sign in to comment.