PHPStan tweaks

This commit is contained in:
Alex Cabal 2022-07-04 12:58:18 -05:00
parent 497f749523
commit de9e8161ce
6 changed files with 22 additions and 3 deletions

View file

@ -87,6 +87,10 @@ class Poll extends PropertiesBase{
// ***********
public static function Get(?int $pollId): Poll{
if($pollId === null){
throw new Exceptions\InvalidPollException();
}
$result = Db::Query('SELECT * from Polls where PollId = ?', [$pollId], 'Poll');
if(sizeof($result) == 0){
@ -97,6 +101,10 @@ class Poll extends PropertiesBase{
}
public static function GetByUrlName(?string $urlName): Poll{
if($urlName === null){
throw new Exceptions\InvalidPollException();
}
$result = Db::Query('SELECT * from Polls where UrlName = ?', [$urlName], 'Poll');
if(sizeof($result) == 0){