diff --git a/phpstan.neon b/phpstan.neon index b93a408..859344a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,6 +9,8 @@ parameters: checkMissingIterableValueType: false ignoreErrors: - '#Call to an undefined method Drupal\\Core\\Field\\FieldItemListInterface::referencedEntities()#' + - '#Call to an undefined method Drupal\\views\\Plugin\\views\\query\\QueryPluginBase::addOrderBy().#' + - '#Call to an undefined method GuzzleHttp\\ClientInterface::post().#' - '#Call to an undefined method Illuminate\\Support\\HigherOrderCollectionProxy::id()#' includes: - vendor/mglaman/phpstan-drupal/extension.neon diff --git a/web/modules/custom/talks/src/EventSubscriber/UpdateTalkNodeBeforeSave.php b/web/modules/custom/talks/src/EventSubscriber/UpdateTalkNodeBeforeSave.php index 5728a9b..3056d22 100644 --- a/web/modules/custom/talks/src/EventSubscriber/UpdateTalkNodeBeforeSave.php +++ b/web/modules/custom/talks/src/EventSubscriber/UpdateTalkNodeBeforeSave.php @@ -31,7 +31,7 @@ final class UpdateTalkNodeBeforeSave implements EventSubscriberInterface { return; } - /** @var \Drupal\opdavies_blog\Entity\Node\Talk $talk */ + /** @var Talk $talk */ $talk = $event->getEntity(); $this->reorderEvents($talk); $this->updateCreatedDate($talk); diff --git a/web/modules/custom/talks/src/Plugin/views/sort/Event.php b/web/modules/custom/talks/src/Plugin/views/sort/Event.php index 68bdc16..d0965a3 100644 --- a/web/modules/custom/talks/src/Plugin/views/sort/Event.php +++ b/web/modules/custom/talks/src/Plugin/views/sort/Event.php @@ -19,8 +19,8 @@ final class Event extends Date { public function __construct( array $configuration, - $pluginId, - $pluginDefinition, + string $pluginId, + array $pluginDefinition, TimeInterface $time ) { parent::__construct($configuration, $pluginId, $pluginDefinition); @@ -42,7 +42,7 @@ final class Event extends Date { ); } - public function query() { + public function query(): void { $this->ensureMyTable(); $currentDate = Carbon::parse('today')->getTimestamp(); diff --git a/web/modules/custom/talks/src/Repository/TalkRepository.php b/web/modules/custom/talks/src/Repository/TalkRepository.php index 2fe40e5..3352fff 100644 --- a/web/modules/custom/talks/src/Repository/TalkRepository.php +++ b/web/modules/custom/talks/src/Repository/TalkRepository.php @@ -6,7 +6,7 @@ namespace Drupal\opdavies_talks\Repository; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\opdavies_blog\Entity\Node\Talk; +use Drupal\opdavies_talks\Entity\Node\Talk; use Illuminate\Support\Collection; final class TalkRepository { diff --git a/web/modules/custom/talks/src/Service/TalkDateUpdater.php b/web/modules/custom/talks/src/Service/TalkDateUpdater.php index 7af638a..60e3797 100644 --- a/web/modules/custom/talks/src/Service/TalkDateUpdater.php +++ b/web/modules/custom/talks/src/Service/TalkDateUpdater.php @@ -30,7 +30,7 @@ final class TalkDateUpdater { } } - private function updateNextEventDate(Talk $talk) { + private function updateNextEventDate(Talk $talk): void { if (!$nextDate = $this->findNextEventDate($talk)) { return; } diff --git a/web/themes/custom/opdavies/opdavies.theme b/web/themes/custom/opdavies/opdavies.theme index 3b222a8..a58c767 100644 --- a/web/themes/custom/opdavies/opdavies.theme +++ b/web/themes/custom/opdavies/opdavies.theme @@ -5,13 +5,13 @@ * Functions to support theming in the Tailwind CSS theme. */ -use Drupal\custom\Entity\Node\Post; +use Drupal\opdavies_blog\Entity\Node\Post; /** * Implements hook_preprocess_HOOK(). */ function opdavies_preprocess_page(array &$variables): void { - /** @var \Drupal\custom\Entity\Node\Post|null $node */ + /** @var Post|null $node */ $node = $variables['node'] ?? NULL; if (!$node) { return;