mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 23:00:28 -04:00
Enable strict exception type hint checking in PHPStan and add exception type hints
This commit is contained in:
parent
559e4a5e05
commit
c4c8e7353f
26 changed files with 300 additions and 82 deletions
|
@ -1,4 +1,6 @@
|
|||
<?
|
||||
|
||||
use Exceptions\InvalidPollVoteException;
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
/**
|
||||
|
@ -86,6 +88,9 @@ class PollVote{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exceptions\InvalidPollVoteException
|
||||
*/
|
||||
public function Create(?string $email = null): void{
|
||||
if($email !== null){
|
||||
try{
|
||||
|
@ -103,13 +108,11 @@ class PollVote{
|
|||
}
|
||||
|
||||
$this->Validate();
|
||||
$this->Created = new DateTimeImmutable();
|
||||
Db::Query('
|
||||
INSERT into PollVotes (UserId, PollItemId, Created)
|
||||
INSERT into PollVotes (UserId, PollItemId)
|
||||
values (?,
|
||||
?,
|
||||
?)
|
||||
', [$this->UserId, $this->PollItemId, $this->Created]);
|
||||
', [$this->UserId, $this->PollItemId]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue