Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Form/Layout/FormLayoutColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

class FormLayoutColumn extends LayoutColumn implements HasLayout
{

/**
* @param (\Closure(FormLayoutFieldset): mixed)|null $callback
* @return $this
*/
public function withFieldset(string $name, ?\Closure $callback = null): self
public function withFieldset(string $name, ?\Closure $callback = null): static
{
$fieldset = new FormLayoutFieldset($name);

Expand Down
12 changes: 6 additions & 6 deletions src/Form/Layout/HasFieldRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait HasFieldRows
protected array $rows = [];

/** @deprecated use withField() or withListField() instead */
public function withSingleField(string $fieldKey, ?\Closure $subLayoutCallback = null): self
public function withSingleField(string $fieldKey, ?\Closure $subLayoutCallback = null): static
{
if ($subLayoutCallback) {
return $this->withListField($fieldKey, $subLayoutCallback);
Expand All @@ -24,7 +24,7 @@ public function withSingleField(string $fieldKey, ?\Closure $subLayoutCallback =
return $this->withField($fieldKey);
}

public function withField(string $fieldKey): self
public function withField(string $fieldKey): static
{
$this->addRowLayout([
$this->newLayoutField($this->normalizedFieldsRow([$fieldKey])->first()),
Expand All @@ -37,7 +37,7 @@ public function withField(string $fieldKey): self
* @param (\Closure(LayoutColumn): mixed) $subLayoutCallback
* @return $this
*/
public function withListField(string $fieldKey, Closure $subLayoutCallback): self
public function withListField(string $fieldKey, Closure $subLayoutCallback): static
{
$this->addRowLayout([
$this->newLayoutField($fieldKey, $subLayoutCallback),
Expand All @@ -46,7 +46,7 @@ public function withListField(string $fieldKey, Closure $subLayoutCallback): sel
return $this;
}

public function withFields(string|int ...$fieldKeys): self
public function withFields(string|int ...$fieldKeys): static
{
$this
->addRowLayout(
Expand All @@ -62,7 +62,7 @@ public function withFields(string|int ...$fieldKeys): self
* @param (\Closure(LayoutColumn): mixed)|null $subLayoutCallback
* @return $this
*/
public function insertSingleFieldAt(int $index, string $fieldKey, ?\Closure $subLayoutCallback = null): self
public function insertSingleFieldAt(int $index, string $fieldKey, ?\Closure $subLayoutCallback = null): static
{
$rows = collect($this->rows);
$rows->splice($index, 0, [[$this->newLayoutField($fieldKey, $subLayoutCallback)]]);
Expand All @@ -71,7 +71,7 @@ public function insertSingleFieldAt(int $index, string $fieldKey, ?\Closure $sub
return $this;
}

public function insertFieldsAt(int $index, string ...$fieldKeys): self
public function insertFieldsAt(int $index, string ...$fieldKeys): static
{
$rows = collect($this->rows);
$rows->splice($index, 0, [
Expand Down
Loading