MAPG-78 [fix] add missing return types to some methods
This commit is contained in:
parent
d55caefda0
commit
675dd7cd07
@ -12,17 +12,17 @@ class ResultSet implements IResultSet
|
||||
$this->result = $result;
|
||||
}
|
||||
|
||||
public function fetch(int $type = IResultSet::FETCH_ASSOC)
|
||||
public function fetch(int $type = IResultSet::FETCH_ASSOC): ?array
|
||||
{
|
||||
return $this->result->fetch_array($this->convertFetchType($type));
|
||||
}
|
||||
|
||||
public function fetchAll(int $type = IResultSet::FETCH_ASSOC)
|
||||
public function fetchAll(int $type = IResultSet::FETCH_ASSOC): array
|
||||
{
|
||||
return $this->result->fetch_all($this->convertFetchType($type));
|
||||
}
|
||||
|
||||
public function fetchOneColumn(string $valueName, string $keyName = null)
|
||||
public function fetchOneColumn(string $valueName, string $keyName = null): array
|
||||
{
|
||||
$array = [];
|
||||
|
||||
|
@ -115,7 +115,7 @@ class Select
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orderBy($column, string $type = 'asc'): Select
|
||||
public function orderBy($column, string $type = 'ASC'): Select
|
||||
{
|
||||
$this->orders[] = [$column, $type];
|
||||
|
||||
@ -394,7 +394,7 @@ class Select
|
||||
$orders = $this->orders;
|
||||
|
||||
array_walk($orders, function (&$value, $key) {
|
||||
$value = $this->generateColumn($value[0]) . ' ' . $value[1];
|
||||
$value = $this->generateColumn($value[0]) . ' ' . strtoupper($value[1]);
|
||||
});
|
||||
|
||||
return implode(',', $orders);
|
||||
|
@ -8,9 +8,9 @@ interface IResultSet
|
||||
|
||||
const FETCH_BOTH = 2;
|
||||
|
||||
public function fetch(int $type);
|
||||
public function fetch(int $type): ?array;
|
||||
|
||||
public function fetchAll(int $type);
|
||||
public function fetchAll(int $type): array;
|
||||
|
||||
public function fetchOneColumn(string $valueName, string $keyName);
|
||||
public function fetchOneColumn(string $valueName, string $keyName): array;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user