Fix PHPStan errors for CollectionType enum

Use the `value` property of PHP enums to get the underlying string for functions that expect a string.

Followup to #392
This commit is contained in:
Mike Colagrosso 2024-09-01 22:32:37 -06:00 committed by Alex Cabal
parent b792dec9e5
commit 9a4da8f961
3 changed files with 4 additions and 4 deletions

View file

@ -129,8 +129,8 @@ catch(Exceptions\EbookNotFoundException){
<? $sequenceNumber = $collectionMembership->SequenceNumber; ?>
<p><? if($sequenceNumber !== null){ ?>№ <?= number_format($sequenceNumber) ?> in the<? }else{ ?>Part of the<? } ?> <a href="<?= $collection->Url ?>" property="schema:isPartOf"><?= Formatter::EscapeHtml(preg_replace('/^The /ius', '', (string)$collection->Name)) ?></a>
<? if($collection->Type !== null){ ?>
<? if(substr_compare(mb_strtolower($collection->Name), mb_strtolower($collection->Type), -strlen(mb_strtolower($collection->Type))) !== 0){ ?>
<?= $collection->Type ?>.
<? if(substr_compare(mb_strtolower($collection->Name), mb_strtolower($collection->Type->value), -strlen(mb_strtolower($collection->Type->value))) !== 0){ ?>
<?= $collection->Type->value ?>.
<? } ?>
<? }else{ ?>
collection.