Skip to content

Commit

Permalink
static is not yet available in php74
Browse files Browse the repository at this point in the history
  • Loading branch information
skoro committed Oct 28, 2022
1 parent f19a74c commit 9de5cd2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Widgets/TreeView/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/TreeView/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Widgets/TreeView/TreeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ protected function initWidgetOptions(): Options
]);
}

public function onSelect(callable $callback): static
public function onSelect(callable $callback): self
{
$this->bind('<<TreeviewSelect>>', fn () => $callback($this->selected(), $this));
return $this;
}

public function onOpen(callable $callback): static
public function onOpen(callable $callback): self
{
$this->bind('<<TreeviewOpen>>', fn () => $callback($this));
return $this;
}

public function onClose(callable $callback): static
public function onClose(callable $callback): self
{
$this->bind('<<TreeviewClose>>', fn () => $callback($this));
return $this;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9de5cd2

Please sign in to comment.