Changes:
- added type-hints - added some missing documentation
This commit is contained in:
parent
f1867463a0
commit
cefffde691
|
@ -218,12 +218,12 @@ class DBA
|
||||||
/**
|
/**
|
||||||
* Check if data exists
|
* Check if data exists
|
||||||
*
|
*
|
||||||
* @param string|array $table Table name or array [schema => table]
|
* @param string $table Table name or array [schema => table]
|
||||||
* @param array $condition array of fields for condition
|
* @param array $condition Array of fields for condition
|
||||||
* @return boolean Are there rows for that condition?
|
* @return boolean Are there rows for that condition?
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function exists($table, array $condition): bool
|
public static function exists(string $table, array $condition): bool
|
||||||
{
|
{
|
||||||
return DI::dba()->exists($table, $condition);
|
return DI::dba()->exists($table, $condition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1527,6 +1527,7 @@ class Database
|
||||||
*/
|
*/
|
||||||
public function count($table, array $condition = [], array $params = []): int
|
public function count($table, array $condition = [], array $params = []): int
|
||||||
{
|
{
|
||||||
|
// @TODO Can we dump this to have ": int" as returned type-hint?
|
||||||
if (empty($table)) {
|
if (empty($table)) {
|
||||||
throw new InvalidArgumentException('Parameter "table" cannot be empty.');
|
throw new InvalidArgumentException('Parameter "table" cannot be empty.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user