Bump PHPStan check level to max and add final round of type hints

This commit is contained in:
Alex Cabal 2024-05-13 10:48:05 -05:00
parent 110c091a7b
commit 70ae877dd8
15 changed files with 86 additions and 52 deletions

View file

@ -9,21 +9,22 @@ class Db{
}
/**
* @param string $query
* @param array<mixed> $args
* @param string $class
* @return Array<mixed>
*/
* @template T
* @param string $query
* @param array<mixed> $args
* @param class-string<T> $class
* @return Array<T>
*/
public static function Query(string $query, array $args = [], string $class = 'stdClass'): array{
return $GLOBALS['DbConnection']->Query($query, $args, $class);
}
/**
* Returns a single integer value for the first column database query result.
* This is useful for queries that return a single integer as a result, like count(*) or sum(*).
* @param string $query
* @param array<mixed> $args
*/
* Returns a single integer value for the first column database query result.
* This is useful for queries that return a single integer as a result, like count(*) or sum(*).
* @param string $query
* @param array<mixed> $args
*/
public static function QueryInt(string $query, array $args = []): int{
$result = $GLOBALS['DbConnection']->Query($query, $args);