From 9de5cd2167f714c61a1c2e2e6f9e8795d4bd8408 Mon Sep 17 00:00:00 2001 From: Skorobogatko Alexei Date: Fri, 28 Oct 2022 10:22:08 +0300 Subject: [PATCH] static is not yet available in php74 --- src/Widgets/TreeView/Column.php | 2 +- src/Widgets/TreeView/Item.php | 2 +- src/Widgets/TreeView/TreeView.php | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Widgets/TreeView/Column.php b/src/Widgets/TreeView/Column.php index 2db1444..e88ffc9 100644 --- a/src/Widgets/TreeView/Column.php +++ b/src/Widgets/TreeView/Column.php @@ -64,7 +64,7 @@ public function header(): Header return $this->header; } - public static function create(string $id, string $header): static + public static function create(string $id, string $header): self { return new static($id, new Header($header)); } diff --git a/src/Widgets/TreeView/Item.php b/src/Widgets/TreeView/Item.php index 4c3f9d7..2d5c6d1 100644 --- a/src/Widgets/TreeView/Item.php +++ b/src/Widgets/TreeView/Item.php @@ -76,7 +76,7 @@ public function options(): Options return $this->options; } - public static function values(array $values): static + public static function values(array $values): self { return new static($values); } diff --git a/src/Widgets/TreeView/TreeView.php b/src/Widgets/TreeView/TreeView.php index af4af0b..cb1db24 100644 --- a/src/Widgets/TreeView/TreeView.php +++ b/src/Widgets/TreeView/TreeView.php @@ -63,19 +63,19 @@ protected function initWidgetOptions(): Options ]); } - public function onSelect(callable $callback): static + public function onSelect(callable $callback): self { $this->bind('<>', fn () => $callback($this->selected(), $this)); return $this; } - public function onOpen(callable $callback): static + public function onOpen(callable $callback): self { $this->bind('<>', fn () => $callback($this)); return $this; } - public function onClose(callable $callback): static + public function onClose(callable $callback): self { $this->bind('<>', fn () => $callback($this)); return $this; @@ -101,21 +101,21 @@ private function setColumnHeader(Column $column): void $this->call('heading', $column->id, '-text', $column->header()->text); } - public function add(Item $item, string $parentId = ''): static + public function add(Item $item, string $parentId = ''): self { $args = $item->options()->asStringArray(); $this->call('insert', $parentId ?: '{}', 'end', ...$args); return $this; } - public function delete(Item ...$items): static + public function delete(Item ...$items): self { $ids = array_map(fn (Item $item) => $item->id, $items); $this->call('delete', ...$ids); return $this; } - public function focusItem(Item $item): static + public function focusItem(Item $item): self { $this->call('focus', $item->id); return $this; @@ -171,7 +171,7 @@ public function getPrevItemId(string $itemId): string /** * Sets the viewport to the specified item. */ - public function seeItemId(string $itemId): static + public function seeItemId(string $itemId): self { $this->call('see', $itemId); return $this;