Type hinting fixes

This commit is contained in:
Alex Cabal 2024-01-08 16:41:44 -06:00
parent e98a650f59
commit ad0badc09e
7 changed files with 15 additions and 15 deletions

View file

@ -2,11 +2,11 @@
class Contributor{ class Contributor{
public string $Name; public string $Name;
public string $UrlName; public string $UrlName;
public ?string $SortName; public ?string $SortName = null;
public ?string $WikipediaUrl; public ?string $WikipediaUrl = null;
public ?string $MarcRole; public ?string $MarcRole = null;
public ?string $FullName; public ?string $FullName = null;
public ?string $NacoafUrl; public ?string $NacoafUrl = null;
public function __construct(string $name, string $sortName = null, string $fullName = null, string $wikipediaUrl = null, string $marcRole = null, string $nacoafUrl = null){ public function __construct(string $name, string $sortName = null, string $fullName = null, string $wikipediaUrl = null, string $marcRole = null, string $nacoafUrl = null){
$this->Name = str_replace('\'', '', $name); $this->Name = str_replace('\'', '', $name);

View file

@ -8,7 +8,7 @@ use function Safe\unlink;
class Image{ class Image{
public string $Path; public string $Path;
public ?ImageMimeType $MimeType; public ?ImageMimeType $MimeType = null;
public function __construct(string $path){ public function __construct(string $path){
$this->Path = $path; $this->Path = $path;

View file

@ -16,7 +16,7 @@ class Museum extends PropertiesBase{
limit 1; limit 1;
', [$url], 'Museum'); ', [$url], 'Museum');
if(sizeof($result[0]) == 0){ if(sizeof($result) == 0){
throw new Exceptions\MuseumNotFoundException(); throw new Exceptions\MuseumNotFoundException();
} }

View file

@ -7,9 +7,9 @@ use Safe\DateTime;
*/ */
class NewsletterSubscription extends PropertiesBase{ class NewsletterSubscription extends PropertiesBase{
public bool $IsConfirmed = false; public bool $IsConfirmed = false;
public bool $IsSubscribedToSummary; public bool $IsSubscribedToSummary = false;
public bool $IsSubscribedToNewsletter; public bool $IsSubscribedToNewsletter = false;
public int $UserId; public ?int $UserId = null;
public DateTime $Created; public DateTime $Created;
protected $_User; protected $_User;
protected $_Url = null; protected $_Url = null;

View file

@ -4,7 +4,7 @@ class OpdsNavigationEntry{
public string $Url; public string $Url;
public string $Rel; public string $Rel;
public string $Type; public string $Type;
public ?DateTime $Updated; public ?DateTime $Updated = null;
public string $Description; public string $Description;
public string $Title; public string $Title;
public string $SortTitle; public string $SortTitle;

View file

@ -8,7 +8,7 @@ class Patron extends PropertiesBase{
public ?int $UserId = null; public ?int $UserId = null;
protected $_User = null; protected $_User = null;
public bool $IsAnonymous; public bool $IsAnonymous;
public ?string $AlternateName; public ?string $AlternateName = null;
public bool $IsSubscribedToEmails; public bool $IsSubscribedToEmails;
public ?DateTime $Created = null; public ?DateTime $Created = null;
public ?DateTime $Ended = null; public ?DateTime $Ended = null;

View file

@ -10,11 +10,11 @@ use Safe\DateTime;
*/ */
class User extends PropertiesBase{ class User extends PropertiesBase{
public int $UserId; public int $UserId;
public ?string $Name; public ?string $Name = null;
public ?string $Email; public ?string $Email = null;
public DateTime $Created; public DateTime $Created;
public string $Uuid; public string $Uuid;
public ?string $PasswordHash; public ?string $PasswordHash = null;
protected ?bool $_IsRegistered = null; protected ?bool $_IsRegistered = null;
protected $_Payments = null; protected $_Payments = null;
protected ?Benefits $_Benefits = null; protected ?Benefits $_Benefits = null;