From dfb43e0fa450b3eebba6df56909ec769da995551 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Thu, 16 May 2024 12:47:01 -0500 Subject: [PATCH] Add more type hints --- www/artworks/edit.php | 1 + www/artworks/get.php | 16 +++++++++------- www/artworks/new.php | 3 ++- www/newsletter/subscriptions/new.php | 2 ++ www/polls/votes/new.php | 2 ++ www/sessions/new.php | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/www/artworks/edit.php b/www/artworks/edit.php index d99efa7f..aaa33a81 100644 --- a/www/artworks/edit.php +++ b/www/artworks/edit.php @@ -3,6 +3,7 @@ use function Safe\session_unset; session_start(); +/** @var ?\Exception $exception */ $exception = $_SESSION['exception'] ?? null; /** @var ?Artwork $artwork */ $artwork = $_SESSION['artwork'] ?? null; diff --git a/www/artworks/get.php b/www/artworks/get.php index b34c6af3..806eec46 100644 --- a/www/artworks/get.php +++ b/www/artworks/get.php @@ -4,6 +4,7 @@ use function Safe\session_unset; session_start(); $saved = HttpInput::Bool(SESSION, 'artwork-saved') ?? false; +/** @var ?\Exception $exception */ $exception = $_SESSION['exception'] ?? null; try{ @@ -33,6 +34,7 @@ try{ // because if the new status is 'approved' then it will hide the status form entirely, // which will be confusing. $oldStatus = $artwork->Status; + /** @var Artwork $artwork */ $artwork = $_SESSION['artwork'] ?? $artwork; $artwork->Status = $oldStatus; @@ -75,7 +77,7 @@ catch(Exceptions\InvalidPermissionsException){ Artist - Artist->Name) ?>Artist->AlternateNames) > 0){ ?> (A.K.A. , ', array_map('Formatter::EscapeHtml', $artwork->Artist->AlternateNames)) ?>)Artist->DeathYear !== null){ ?> (d. Artist->DeathYear ?>) (#Artist->ArtistId ?>) + Artist->Name) ?>Artist->AlternateNames ?? []) > 0){ ?> (A.K.A. , ', array_map('Formatter::EscapeHtml', $artwork->Artist->AlternateNames)) ?>)Artist->DeathYear !== null){ ?> (d. Artist->DeathYear ?>) (#Artist->ArtistId ?>) @@ -126,7 +128,7 @@ catch(Exceptions\InvalidPermissionsException){ PublicationYear !== null){ ?>

Page scans

    -
  • Year book was published: PublicationYear !== null){ ?>PublicationYear ?>Not provided
  • +
  • Year book was published: PublicationYear ?>
  • Page scan of book publication year: PublicationYearPageUrl !== null){ ?>LinkNot provided
  • Page scan of rights statement: CopyrightPageUrl !== null){ ?>LinkNot provided
  • Page scan of artwork: ArtworkPageUrl !== null){ ?>LinkNot provided
  • @@ -143,20 +145,20 @@ catch(Exceptions\InvalidPermissionsException){ Notes) ?> - CanBeEditedBy($GLOBALS['User'] ?? null)){ ?> + CanBeEditedBy($GLOBALS['User'])){ ?>

    Edit artwork

    The editor or submitter may edit this artwork before it’s approved. Once it’s approved, it can no longer be edited.

    Edit this artwork.

    - CanStatusBeChangedBy($GLOBALS['User'] ?? null) || $artwork->CanEbookUrlBeChangedBy($GLOBALS['User'] ?? null)){ ?> + CanStatusBeChangedBy($GLOBALS['User']) || $artwork->CanEbookUrlBeChangedBy($GLOBALS['User'])){ ?>

    Editor options

    - CanStatusBeChangedBy($GLOBALS['User'] ?? null)){ ?> + CanStatusBeChangedBy($GLOBALS['User'])){ ?>

    Review the metadata and PD proof for this artwork submission. Approve to make it available for future producers. Once an artwork is approved, it can no longer be edited.

    - CanStatusBeChangedBy($GLOBALS['User'] ?? null)){ ?> + CanStatusBeChangedBy($GLOBALS['User'])){ ?>