diff --git a/Makefile b/Makefile index 0d806d1..d70f93d 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,12 @@ SHELL=/bin/bash -e -o pipefail .PHONY: * phpcs: - symfony php vendor/bin/phpcs -n \ - --standard="Drupal,DrupalPractice" \ - --extensions="php,module,inc,install,test,profile,theme" \ - --ignore=*/tests/* \ - --exclude="Drupal.Commenting.ClassComment,Drupal.Commenting.FunctionComment" \ - web/modules/custom - symfony php vendor/bin/phpcs -n \ --standard="Drupal,DrupalPractice" \ --extensions="php,module,inc,install,test,profile,theme" \ - --exclude="Drupal.Commenting.ClassComment,Drupal.Commenting.DocComment,Drupal.Commenting.FunctionComment,Drupal.NamingConventions.ValidFunctionName" \ - web/modules/custom/**/tests + --exclude="Drupal.Commenting.ClassComment,Drupal.Commenting.FunctionComment,Drupal.Commenting.VariableComment" \ + web/modules/custom \ + web/themes/custom phpstan: vendor/bin/phpstan analyze diff --git a/phpstan.neon b/phpstan.neon index 21de235..b93a408 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -8,8 +8,8 @@ parameters: - *TestBase.php checkMissingIterableValueType: false ignoreErrors: - - '#Call to an undefined method Drupal\\Core\\Entity\\EntityInterface::set()#' - - '#Call to an undefined method Drupal\\Core\\Field\\FieldItemListInterface::referencedEntities()#' + - '#Call to an undefined method Drupal\\Core\\Field\\FieldItemListInterface::referencedEntities()#' + - '#Call to an undefined method Illuminate\\Support\\HigherOrderCollectionProxy::id()#' includes: - vendor/mglaman/phpstan-drupal/extension.neon - vendor/phpstan/phpstan-deprecation-rules/rules.neon diff --git a/web/modules/custom/custom/src/EventSubscriber/UpdateTalkNodeBeforeSave.php b/web/modules/custom/custom/src/EventSubscriber/UpdateTalkNodeBeforeSave.php index 05e8c4b..803727d 100644 --- a/web/modules/custom/custom/src/EventSubscriber/UpdateTalkNodeBeforeSave.php +++ b/web/modules/custom/custom/src/EventSubscriber/UpdateTalkNodeBeforeSave.php @@ -32,8 +32,10 @@ final class UpdateTalkNodeBeforeSave implements EventSubscriberInterface { return; } - $this->reorderEvents($event->getEntity()); - $this->updateCreatedDate($event->getEntity()); + /** @var \Drupal\custom\Entity\Node\Talk $talk */ + $talk = $event->getEntity(); + $this->reorderEvents($talk); + $this->updateCreatedDate($talk); } private function reorderEvents(Talk $talk): void { diff --git a/web/themes/custom/opdavies/opdavies.theme b/web/themes/custom/opdavies/opdavies.theme index a270343..157b5cd 100644 --- a/web/themes/custom/opdavies/opdavies.theme +++ b/web/themes/custom/opdavies/opdavies.theme @@ -11,8 +11,9 @@ use Drupal\custom\Entity\Node\Post; * Implements hook_preprocess_HOOK(). */ function opdavies_preprocess_page(array &$variables): void { - /** @var \Drupal\custom\Entity\Node\Post $node */ - if (!$node = $variables['node'] ?? NULL) { + /** @var \Drupal\custom\Entity\Node\Post|null $node */ + $node = $variables['node'] ?? NULL; + if (!$node) { return; }