Fix phpstan errors

This commit is contained in:
Oliver Davies 2025-06-21 00:42:49 +01:00
parent 9abf64b504
commit addfe15e26
3 changed files with 8 additions and 1 deletions

View file

@ -22,7 +22,10 @@ readonly final class AddRandomCtaToDailyEmail {
return; return;
} }
if (str_contains(haystack: $email->get('body')->value, needle: 'P.S.')) { $body = $email->get('body')->value;
assert(is_string($body));
if (str_contains(haystack: $body, needle: 'P.S.')) {
return; return;
} }

View file

@ -23,7 +23,9 @@ final class PresentationNodeRepository implements PresentationRepositoryInterfac
$query->condition('status', NodeInterface::PUBLISHED); $query->condition('status', NodeInterface::PUBLISHED);
$nodeIds = $query->execute(); $nodeIds = $query->execute();
assert(is_array($nodeIds));
/** @var Presentation[] */
return $this->nodeStorage->loadMultiple($nodeIds); return $this->nodeStorage->loadMultiple($nodeIds);
} }

View file

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Drupal\opd_presentations\Repository; namespace Drupal\opd_presentations\Repository;
use Drupal\opd_presentations\Presentation;
interface PresentationRepositoryInterface { interface PresentationRepositoryInterface {
/** /**