From b266a7233686ba27c762adc7b7b0a7aa8be9477a Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 23 Sep 2024 10:44:01 -0400 Subject: [PATCH] chore(YSP-650): fix linting issues --- .../custom/ys_core/src/Plugin/Action/ModeratedPublish.php | 2 +- .../custom/ys_core/src/Plugin/Action/ModeratedUnpublish.php | 2 +- .../modules/custom/ys_layouts/src/Service/LayoutUpdater.php | 2 +- .../modules/custom/ys_localist/src/MetaFieldsManager.php | 2 +- .../src/Plugin/migrate_plus/data_parser/LocalistJson.php | 2 +- .../yalesites_profile/modules/custom/ys_themes/ys_themes.module | 2 +- .../ys_views_basic/src/Plugin/views/filter/PostYearFilter.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedPublish.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedPublish.php index 65cb92234d..039c6f77a9 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedPublish.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedPublish.php @@ -27,7 +27,7 @@ public function execute($entity = NULL) { /** * {@inheritdoc} */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { + public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) { $key = $object->getEntityType()->getKey('published'); /** @var \Drupal\Core\Entity\EntityInterface $object */ diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedUnpublish.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedUnpublish.php index 20325818bb..460b10bbc5 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedUnpublish.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Plugin/Action/ModeratedUnpublish.php @@ -27,7 +27,7 @@ public function execute($entity = NULL) { /** * {@inheritdoc} */ - public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { + public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) { $key = $object->getEntityType()->getKey('published'); /** @var \Drupal\Core\Entity\EntityInterface $object */ diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/Service/LayoutUpdater.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/Service/LayoutUpdater.php index 2bcaf6660d..a75694c344 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/Service/LayoutUpdater.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/Service/LayoutUpdater.php @@ -2,7 +2,6 @@ namespace Drupal\ys_layouts\Service; -use Drupal\block_content\Entity\BlockContent; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityFieldManager; @@ -10,6 +9,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\block_content\Entity\BlockContent; use Drupal\node\NodeInterface; use Psr\Log\LoggerInterface; diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php index 7df6cb1ae2..5b2cfa4dc6 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php @@ -2,11 +2,11 @@ namespace Drupal\ys_localist; -use Drupal\calendar_link\Twig\CalendarLinkTwigExtension; use Drupal\Core\Datetime\DateFormatter; use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Url; +use Drupal\calendar_link\Twig\CalendarLinkTwigExtension; use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/Plugin/migrate_plus/data_parser/LocalistJson.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/Plugin/migrate_plus/data_parser/LocalistJson.php index c1d7ca7ab7..094fd64fdc 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/Plugin/migrate_plus/data_parser/LocalistJson.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/Plugin/migrate_plus/data_parser/LocalistJson.php @@ -49,7 +49,7 @@ protected function getSourceData(string $url): array { // If json_decode() has returned NULL, it might be that the data isn't // valid utf8 see http://php.net/manual/en/function.json-decode.php#86997. if (is_null($source_data)) { - $utf8response = utf8_encode($response); + $utf8response = mb_convert_encoding($response, 'UTF-8', 'ISO-8859-1'); $source_data = json_decode($utf8response, TRUE, 512, JSON_THROW_ON_ERROR); } diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module index d675ad1140..0d4db3f42e 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/ys_themes.module @@ -25,7 +25,7 @@ use Drupal\field\Entity\FieldStorageConfig; * * @see options_allowed_values() */ -function ys_themes_allowed_values_function(FieldStorageConfig $definition, ContentEntityInterface $entity = NULL, $cacheable) { +function ys_themes_allowed_values_function(FieldStorageConfig $definition, ?ContentEntityInterface $entity = NULL, $cacheable) { $options = []; $config = \Drupal::config('ys_themes.component_overrides'); diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/views/filter/PostYearFilter.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/views/filter/PostYearFilter.php index bb9dc2b371..5c9b2f9abc 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/views/filter/PostYearFilter.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/views/filter/PostYearFilter.php @@ -56,7 +56,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * {@inheritdoc} */ - public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { + public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) { parent::init($view, $display, $options); $this->valueTitle = $this->t('Post Year Filter');