mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 15:50:29 -04:00
Add type hints and quiet a few other PHPStan complaints
This commit is contained in:
parent
c9ebd71587
commit
9f3104025d
5 changed files with 35 additions and 12 deletions
11
lib/Db.php
11
lib/Db.php
|
@ -1,11 +1,18 @@
|
|||
<?
|
||||
|
||||
class Db{
|
||||
public static function GetLastInsertedId(){
|
||||
public static function GetLastInsertedId(): int{
|
||||
return $GLOBALS['DbConnection']->GetLastInsertedId();
|
||||
}
|
||||
|
||||
public static function Query(string $query, $args = []){
|
||||
/**
|
||||
* @return Array<mixed>
|
||||
*/
|
||||
public static function Query(string $query, array $args = []): array{
|
||||
if(!isset($GLOBALS['DbConnection'])){
|
||||
$GLOBALS['DbConnection'] = new DbConnection(DATABASE_DEFAULT_DATABASE, DATABASE_DEFAULT_HOST);
|
||||
}
|
||||
|
||||
if(!is_array($args)){
|
||||
$args = [$args];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue