diff --git a/src/FilterGroup.php b/src/FilterGroup.php index 69da5a1..73c4c01 100644 --- a/src/FilterGroup.php +++ b/src/FilterGroup.php @@ -13,6 +13,8 @@ * * @author Unay Santisteban * @package ComplexHeart\Domain\Criteria + * + * @extends TypedCollection */ final class FilterGroup extends TypedCollection { @@ -23,23 +25,27 @@ final class FilterGroup extends TypedCollection /** * FilterGroup constructor. * - * @param array $items + * @param array $items */ public function __construct(array $items = []) { parent::__construct(array_unique($items)); } - public static function create(Filter ...$filters): self + /** + * @param Filter ...$filters + * @return FilterGroup + */ + public static function create(Filter ...$filters): FilterGroup { - return new self($filters); + return new self(array_values($filters)); } /** - * @param array|array> $filters - * @return self + * @param array> $filters + * @return FilterGroup */ - public static function createFromArray(array $filters): self + public static function createFromArray(array $filters): FilterGroup { return self::create( ...map(fn(array $filter): Filter => Filter::createFromArray($filter), $filters)