From de76e51154348542d6fdb6772432e73f5e6c7394 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 16 Apr 2022 20:16:42 +0300 Subject: [PATCH] feat(entries): add ability to set mixed type options and registry --- src/flextype/core/Entries/Entries.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/flextype/core/Entries/Entries.php b/src/flextype/core/Entries/Entries.php index fceb8014..c7a48d9e 100755 --- a/src/flextype/core/Entries/Entries.php +++ b/src/flextype/core/Entries/Entries.php @@ -62,19 +62,19 @@ class Entries * fields: - array - Array of fields for entries collection. * events: - array - Array of events for entries collection. * - * @var array + * @var Collection * * @access private */ - private array $options = []; + private Collection $options; /** * Create a new entries object. * - * @param array $options Entries options. - * @param array $registry Entries registry. + * @param mixed $options Entries options. + * @param mixed $registry Entries registry. */ - public function __construct(array $options = [], array $registry = []) + public function __construct($options = null, $registry = null) { $this->setRegistry($registry); $this->setOptions($options); @@ -843,7 +843,7 @@ class Entries * * @access public */ - public function setRegistry(array $registry = []): self + public function setRegistry($registry = null): self { $this->registry = collection($registry); @@ -857,9 +857,9 @@ class Entries * * @access public */ - public function setOptions(array $options = []): self + public function setOptions($options = null): self { - $this->options = $options; + $this->options = collection($options); return $this; } @@ -871,7 +871,7 @@ class Entries * * @access public */ - public function getOptions(): array + public function options(): Collection { return $this->options; }