More type hinting

This commit is contained in:
Alex Cabal 2024-01-08 20:21:42 -06:00
parent cb79832092
commit 1c3640fab6
6 changed files with 56 additions and 29 deletions

View file

@ -72,17 +72,27 @@ class Artwork extends PropertiesBase{
return $this->_UrlName;
}
protected function GetSubmitter(): User{
protected function GetSubmitter(): ?User{
if($this->_Submitter === null){
$this->_Submitter = User::Get($this->SubmitterUserId);
try{
$this->_Submitter = User::Get($this->SubmitterUserId);
}
catch(Exceptions\InvalidUserException){
// Return null
}
}
return $this->_Submitter;
}
protected function GetReviewer(): User{
protected function GetReviewer(): ?User{
if($this->_Reviewer === null){
$this->_Reviewer = User::Get($this->ReviewerUserId);
try{
$this->_Reviewer = User::Get($this->ReviewerUserId);
}
catch(Exceptions\InvalidUserException){
// Return null
}
}
return $this->_Reviewer;