Skip to content

Commit

Permalink
more strict types in sand
Browse files Browse the repository at this point in the history
  • Loading branch information
Vítězslav Dvořák committed Nov 13, 2024
1 parent b3e2ca5 commit d57fe48
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Ease/Sand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getData()
*
* @return int
*/
public function getDataCount()
public function getDataCount(): int
{
return empty($this->data) ? 0 : \count($this->data);
}
Expand All @@ -127,7 +127,7 @@ public function getDataValue($columnName)
*
* @return bool Success
*/
public function setDataValue(string $columnName, $value)
public function setDataValue(string $columnName, $value): bool
{
$this->data[$columnName] = $value;

Expand All @@ -141,7 +141,7 @@ public function setDataValue(string $columnName, $value)
*
* @return bool success
*/
public function unsetDataValue(string $columnName)
public function unsetDataValue(string $columnName): bool
{
$result = false;

Expand All @@ -155,19 +155,15 @@ public function unsetDataValue(string $columnName)

/**
* Převezme data do aktuálního pole dat.
*
* @param array $data asociativní pole dat
*
* @return int
*/
public function takeData($data)
public function takeData(array $data): int
{
if (\is_array($this->data) && \is_array($data)) {
$this->data = array_merge($this->data, $data);
} else {
$this->data = $data;
}

return empty($data) ? null : \count($data);
return empty($data) ? 0 : \count($data);
}
}

0 comments on commit d57fe48

Please sign in to comment.