Skip to content

Commit

Permalink
changing return to voids.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilverloop committed Feb 22, 2021
1 parent 7d20334 commit 2aad99a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 5 additions & 7 deletions src/Columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function rewind(): void
* @throws \OutOfBoundsException if a key is missing.
* @throws \InvalidArgumentException if the values are not of the proper types.
* @throws \UnexpectedValueException if "searchable" or "orderable" are not "true" or "false".
* @return $this
* @return void
*/
private function addFromArray(array $columnDatas)
private function addFromArray(array $columnDatas): void
{
if (
array_key_exists('data', $columnDatas) === false ||
Expand Down Expand Up @@ -90,19 +90,17 @@ private function addFromArray(array $columnDatas)
$orderable = true;
}

return $this->add(new Column($columnDatas['data'], $searchable, $orderable));
$this->add(new Column($columnDatas['data'], $searchable, $orderable));
}

/**
* Adds a column.
* @param \CyrilVerloop\Datatables\Column $column the column.
* @return $this
* @return void
*/
public function add(Column $column)
public function add(Column $column): void
{
$this->list[] = $column;

return $this;
}

/**
Expand Down
12 changes: 5 additions & 7 deletions src/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public function rewind(): void
* @param mixed[] $orderDatas the datas.
* @throws \OutOfBoundsException if a key is missing.
* @throws \InvalidArgumentException if "column" is not an integer.
* @return $this
* @return void
*/
private function addFromArray(array $orderDatas)
private function addFromArray(array $orderDatas): void
{
if (
array_key_exists('column', $orderDatas) === false ||
Expand All @@ -58,18 +58,16 @@ private function addFromArray(array $orderDatas)
throw new \OutOfBoundsException('orders.key.notExist');
}

return $this->add(new Order((int)$orderDatas['column'], (string)$orderDatas['dir']));
$this->add(new Order((int)$orderDatas['column'], (string)$orderDatas['dir']));
}

/**
* Adds an order.
* @param \CyrilVerloop\Datatables\Order $order an order.
* @return $this
* @return void
*/
public function add(Order $order)
public function add(Order $order): void
{
$this->list[] = $order;

return $this;
}
}

0 comments on commit 2aad99a

Please sign in to comment.