From 792e8d5594cbe6595da21354c8fd2da2d465128b Mon Sep 17 00:00:00 2001 From: Adam Nagy Date: Mon, 13 Jan 2025 16:47:17 +0100 Subject: [PATCH] EWPP-4991: Ensure PHP8.3 compatibility. --- .drone.yml | 32 +++++++++--------- composer.json | 24 +++++++++----- docker-compose.yml | 7 ++-- grumphp.yml.dist | 33 ++++--------------- .../oe_theme_content_call_tenders.info.yml | 2 -- ....style.oe_theme_extra_large_3_1_banner.yml | 1 - ....style.oe_theme_extra_large_4_1_banner.yml | 1 - ....style.oe_theme_extra_large_5_1_banner.yml | 1 - .../image.style.oe_theme_large_3_1_banner.yml | 1 - .../image.style.oe_theme_large_4_1_banner.yml | 1 - .../image.style.oe_theme_large_5_1_banner.yml | 1 - ...image.style.oe_theme_medium_3_1_banner.yml | 1 - ...image.style.oe_theme_medium_4_1_banner.yml | 1 - .../image.style.oe_theme_small_3_1_banner.yml | 1 - .../image.style.oe_theme_small_4_1_banner.yml | 1 - .../image.style.oe_theme_small_5_1_banner.yml | 1 - .../SocialMediaLinksFormatter.php | 1 + .../src/Plugin/MediaDataExtractor/Iframe.php | 2 +- .../page_header_metadata_test.info.yml | 1 - .../FeaturedMediaFormatterTest.php | 2 +- .../MediaGalleryFormatterTest.php | 2 +- .../MediaThumbnailUrlFormatterTestBase.php | 2 +- ...y.paragraph.oe_banner.oe_banner_simple.yml | 1 - ...y_form_mode.paragraph.oe_banner_simple.yml | 1 - ...y.paragraph.oe_banner.oe_banner_simple.yml | 1 - ...y_form_mode.paragraph.oe_banner_simple.yml | 1 - modules/oe_theme_test/oe_theme_test.info.yml | 1 - oe_theme.theme | 12 +++++-- phpstan.neon.dist | 2 ++ templates/patterns/link/link.ui_patterns.yml | 2 +- .../navigation_list.ui_patterns.yml | 1 - templates/patterns/tabs/tabs.ui_patterns.yml | 1 - .../Functional/CorporateFooterRenderTest.php | 2 +- tests/src/Kernel/ContactRenderTest.php | 14 ++++++++ tests/src/Kernel/StatusMessagesTest.php | 2 +- .../oe_theme_subtheme_test.info.yml | 1 - 36 files changed, 74 insertions(+), 87 deletions(-) create mode 100644 phpstan.neon.dist diff --git a/.drone.yml b/.drone.yml index acb64a5b4..59ea9bce7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,8 +19,8 @@ services: - COMPOSERVER=--2 - DOCUMENT_ROOT=/test/oe_theme mysql: - image: git.fpfis.tech.ec.europa.eu/fpfis/dependency_proxy/containers/percona:5.7 - command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3 + image: git.fpfis.tech.ec.europa.eu/fpfis/dependency_proxy/containers/percona:8.0 + command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3 --skip-log-bin --innodb-flush-log-at-trx-commit=2 --innodb-read-io-threads=16 --innodb-write-io-threads=16 environment: - MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_DATABASE=drupal @@ -130,22 +130,22 @@ pipeline: matrix: include: - - { PHP_VERSION: 8.1, CORE_VERSION: 10.2.0, TYPE: behat } - - { PHP_VERSION: 8.1, CORE_VERSION: 10.2.0, TYPE: phpunit, BATCH: batch1 } - - { PHP_VERSION: 8.1, CORE_VERSION: 10.2.0, TYPE: phpunit, BATCH: batch2 } - - { PHP_VERSION: 8.1, CORE_VERSION: 10.2.0, TYPE: phpunit, BATCH: batch3 } - - - { PHP_VERSION: 8.2, CORE_VERSION: 10.2.0, TYPE: behat } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.2.0, TYPE: phpunit, BATCH: batch1 } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.2.0, TYPE: phpunit, BATCH: batch2 } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.2.0, TYPE: phpunit, BATCH: batch3 } - - { PHP_VERSION: 8.1, CORE_VERSION: 10.3.0, TYPE: behat } - { PHP_VERSION: 8.1, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch1 } - { PHP_VERSION: 8.1, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch2 } - { PHP_VERSION: 8.1, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch3 } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.3.0, TYPE: behat } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch1 } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch2 } - - { PHP_VERSION: 8.2, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch3 } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.3.0, TYPE: behat } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch1 } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch2 } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.3.0, TYPE: phpunit, BATCH: batch3 } + + - { PHP_VERSION: 8.1, CORE_VERSION: 10.4.0, TYPE: behat } + - { PHP_VERSION: 8.1, CORE_VERSION: 10.4.0, TYPE: phpunit, BATCH: batch1 } + - { PHP_VERSION: 8.1, CORE_VERSION: 10.4.0, TYPE: phpunit, BATCH: batch2 } + - { PHP_VERSION: 8.1, CORE_VERSION: 10.4.0, TYPE: phpunit, BATCH: batch3 } + + - { PHP_VERSION: 8.3, CORE_VERSION: 10.4.0, TYPE: behat } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.4.0, TYPE: phpunit, BATCH: batch1 } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.4.0, TYPE: phpunit, BATCH: batch2 } + - { PHP_VERSION: 8.3, CORE_VERSION: 10.4.0, TYPE: phpunit, BATCH: batch3 } diff --git a/composer.json b/composer.json index 56b8a6aa6..8a3aecad9 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "mikey179/vfsstream": "^1.6.10", "nikic/php-parser": "^4.18", "openeuropa/behat-transformation-context": "^0.2", - "openeuropa/code-review": "^2.0.0-alpha6", + "openeuropa/code-review-drupal": "^1.0.0-alpha", "openeuropa/oe_contact_forms": "^1.14", "openeuropa/oe_content": "^4.0.0", "openeuropa/oe_corporate_blocks": "4.x-dev", @@ -57,7 +57,7 @@ "openeuropa/oe_search": "^2.0@beta", "openeuropa/oe_webtools": "^1.23", "openeuropa/rdf_skos": "^1.0.0", - "openeuropa/task-runner-drupal-project-symlink": "^1.0.0-beta6", + "openeuropa/task-runner-drupal-project-symlink": "^1.0", "phpspec/prophecy-phpunit": "^2", "symfony/phpunit-bridge": "^6.0" }, @@ -83,16 +83,20 @@ "Drupal\\Tests\\oe_media\\": "./build/modules/contrib/oe_media/tests/src/" } }, - "repositories": { - "drupal": { + "repositories": [ + { "type": "composer", "url": "https://packages.drupal.org/8" }, - "media_avportal": { + { "type": "git", - "url": "https://github.com/openeuropa/media_avportal" + "url": "https://github.com/openeuropa/DrupalDriver.git" + }, + { + "type": "git", + "url": "https://github.com/openeuropa/code-review-drupal.git" } - }, + ], "extra": { "composer-exit-on-patch-failure": true, "enable-patching": true, @@ -129,11 +133,13 @@ "sort-packages": true, "allow-plugins": { "composer/installers": true, - "drupal/core-composer-scaffold": true, "cweagans/composer-patches": true, "dealerdirect/phpcodesniffer-composer-installer": true, + "drupal/core-composer-scaffold": true, + "php-http/discovery": false, "phpro/grumphp": true, - "php-http/discovery": false + "phpro/grumphp-shim": true, + "phpstan/extension-installer": true } } } diff --git a/docker-compose.yml b/docker-compose.yml index f73298158..e0723e6c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ -version: '2' services: web: - image: fpfis/httpd-php-dev:8.1 + image: fpfis/httpd-php-dev:8.3 working_dir: /var/www/html ports: - 8080:8080 @@ -17,8 +16,8 @@ services: # Enable step debugging for all PHP request. See ./README.md#step-debugging for more information. # XDEBUG_SESSION: 1 mysql: - image: percona/percona-server:5.7 - command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3 + image: percona/percona-server:8.0 + command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3 --skip-log-bin --innodb-flush-log-at-trx-commit=2 --innodb-read-io-threads=16 --innodb-write-io-threads=16 environment: MYSQL_ALLOW_EMPTY_PASSWORD: "yes" # ports: diff --git a/grumphp.yml.dist b/grumphp.yml.dist index 559dedaf4..af65fba54 100644 --- a/grumphp.yml.dist +++ b/grumphp.yml.dist @@ -1,33 +1,12 @@ imports: - - { resource: vendor/openeuropa/code-review/dist/drupal-conventions.yml } -parameters: - tasks.phpcs.ignore_patterns: - - vendor/ - - node_modules/ - - build/ - tasks.phpcs.triggered_by: - - php - - module - - inc - - theme - - install - - extra_tasks: + - { resource: ./vendor/openeuropa/code-review-drupal/dist/oe-component-conventions.yml } +grumphp: + tasks: phpparser: ignore_patterns: - vendor/ - - node_modules/ - - build/ - visitors: - declare_strict_types: ~ - triggered_by: - - php - - module - - inc - - theme - - install -grumphp: - extensions: - - OpenEuropa\CodeReview\ExtraTasksExtension git_hook_variables: EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web' + +parameters: + tasks.phpstan.configuration: phpstan.neon.dist diff --git a/modules/oe_theme_content_call_tenders/oe_theme_content_call_tenders.info.yml b/modules/oe_theme_content_call_tenders/oe_theme_content_call_tenders.info.yml index 7331d42e8..c8e6bb1df 100644 --- a/modules/oe_theme_content_call_tenders/oe_theme_content_call_tenders.info.yml +++ b/modules/oe_theme_content_call_tenders/oe_theme_content_call_tenders.info.yml @@ -9,5 +9,3 @@ dependencies: - oe_content:oe_content_call_tenders - oe_theme:oe_theme_helper - oe_time_caching:oe_time_caching - - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_3_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_3_1_banner.yml index 47788ff1e..65fcfb900 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_3_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_3_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 1140 height: 380 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_4_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_4_1_banner.yml index 3e1ad6cd7..f754f7fc1 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_4_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_4_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 1140 height: 285 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_5_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_5_1_banner.yml index 5fa911c30..18896476b 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_5_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_extra_large_5_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 1140 height: 228 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_large_3_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_large_3_1_banner.yml index 08d3e935b..cb6325c53 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_large_3_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_large_3_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 996 height: 332 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_large_4_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_large_4_1_banner.yml index ff3373a98..15c284508 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_large_4_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_large_4_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 996 height: 249 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_large_5_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_large_5_1_banner.yml index 8f48c9bc8..c03849e35 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_large_5_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_large_5_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 996 height: 199 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_3_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_3_1_banner.yml index cef74d011..7d613fa14 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_3_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_3_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 768 height: 256 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_4_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_4_1_banner.yml index 6da120818..a82e8ccdb 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_4_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_medium_4_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 768 height: 192 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_small_3_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_small_3_1_banner.yml index 10689d82d..3df6bf2fd 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_small_3_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_small_3_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 480 height: 160 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_small_4_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_small_4_1_banner.yml index 61ec92f6e..9f1073855 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_small_4_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_small_4_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 480 height: 120 anchor: center-center - diff --git a/modules/oe_theme_helper/config/install/image.style.oe_theme_small_5_1_banner.yml b/modules/oe_theme_helper/config/install/image.style.oe_theme_small_5_1_banner.yml index 02e015d11..33e2f70d5 100644 --- a/modules/oe_theme_helper/config/install/image.style.oe_theme_small_5_1_banner.yml +++ b/modules/oe_theme_helper/config/install/image.style.oe_theme_small_5_1_banner.yml @@ -12,4 +12,3 @@ effects: width: 480 height: 96 anchor: center-center - diff --git a/modules/oe_theme_helper/src/Plugin/Field/FieldFormatter/SocialMediaLinksFormatter.php b/modules/oe_theme_helper/src/Plugin/Field/FieldFormatter/SocialMediaLinksFormatter.php index d2ab12b69..a9d2e5af9 100755 --- a/modules/oe_theme_helper/src/Plugin/Field/FieldFormatter/SocialMediaLinksFormatter.php +++ b/modules/oe_theme_helper/src/Plugin/Field/FieldFormatter/SocialMediaLinksFormatter.php @@ -40,6 +40,7 @@ public static function defaultSettings() { * {@inheritdoc} */ public function settingsSummary() { + $settings = $this->getSettings(); $summary = parent::settingsSummary(); if (!empty($settings['title'])) { diff --git a/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Iframe.php b/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Iframe.php index 7af68d541..37618ec87 100644 --- a/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Iframe.php +++ b/modules/oe_theme_helper/src/Plugin/MediaDataExtractor/Iframe.php @@ -79,7 +79,7 @@ public function getSource(MediaInterface $media): ?string { ->viewField($media->get($source_field), 'oe_theme_main_content'); // Bubble the cacheability information in the current render context. - $markup = $this->renderer->renderPlain($build); + $markup = $this->renderer->renderInIsolation($build); // If the source is rendered as iframe tag, use the src attribute. if (isset($build[0]['#type']) && $build[0]['#type'] === 'html_tag' && $build[0]['#tag'] === 'iframe') { diff --git a/modules/oe_theme_helper/tests/modules/page_header_metadata_test/page_header_metadata_test.info.yml b/modules/oe_theme_helper/tests/modules/page_header_metadata_test/page_header_metadata_test.info.yml index 6dd714ce1..bf7e5632d 100644 --- a/modules/oe_theme_helper/tests/modules/page_header_metadata_test/page_header_metadata_test.info.yml +++ b/modules/oe_theme_helper/tests/modules/page_header_metadata_test/page_header_metadata_test.info.yml @@ -2,5 +2,4 @@ name: 'PageHeaderMetadata test' type: module description: 'PageHeaderMetadata test module.' package: Testing -version: VERSION core_version_requirement: ^10 diff --git a/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/FeaturedMediaFormatterTest.php b/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/FeaturedMediaFormatterTest.php index d3c11b7dd..1380819a2 100644 --- a/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/FeaturedMediaFormatterTest.php +++ b/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/FeaturedMediaFormatterTest.php @@ -69,7 +69,7 @@ protected function setUp(): void { ]); // Call the install hook of the Media module. - module_load_include('install', 'media'); + $this->container->get('module_handler')->loadInclude('media', 'install'); media_install(); // Create a content type. diff --git a/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaGalleryFormatterTest.php b/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaGalleryFormatterTest.php index 471dadb3a..7c3949c78 100644 --- a/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaGalleryFormatterTest.php +++ b/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaGalleryFormatterTest.php @@ -61,7 +61,7 @@ protected function setUp(): void { ]); // Call the install hook of the Media module. - module_load_include('install', 'media'); + $this->container->get('module_handler')->loadInclude('media', 'install'); media_install(); // Add a copyright field to some of the media bundles used in the test. Use diff --git a/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaThumbnailUrlFormatterTestBase.php b/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaThumbnailUrlFormatterTestBase.php index f6ff67aa8..5006e74f8 100644 --- a/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaThumbnailUrlFormatterTestBase.php +++ b/modules/oe_theme_helper/tests/src/Kernel/Plugin/Field/FieldFormatter/MediaThumbnailUrlFormatterTestBase.php @@ -45,7 +45,7 @@ protected function setUp(): void { ]); // Call the install hook of the Media module. - module_load_include('install', 'media'); + $this->container->get('module_handler')->loadInclude('media', 'install'); media_install(); } diff --git a/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml b/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml index 42b66c04c..1e5efe25c 100644 --- a/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml +++ b/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml @@ -81,4 +81,3 @@ hidden: created: true field_oe_banner_type: true status: true - diff --git a/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_mode.paragraph.oe_banner_simple.yml b/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_mode.paragraph.oe_banner_simple.yml index 882ab0b0d..fd67753f0 100644 --- a/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_mode.paragraph.oe_banner_simple.yml +++ b/modules/oe_theme_paragraphs_banner/config/install/core.entity_form_mode.paragraph.oe_banner_simple.yml @@ -8,4 +8,3 @@ label: 'Simple banner' description: '' targetEntityType: paragraph cache: true - diff --git a/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml b/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml index 42b66c04c..1e5efe25c 100644 --- a/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml +++ b/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_display.paragraph.oe_banner.oe_banner_simple.yml @@ -81,4 +81,3 @@ hidden: created: true field_oe_banner_type: true status: true - diff --git a/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_mode.paragraph.oe_banner_simple.yml b/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_mode.paragraph.oe_banner_simple.yml index 882ab0b0d..fd67753f0 100644 --- a/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_mode.paragraph.oe_banner_simple.yml +++ b/modules/oe_theme_paragraphs_banner/config/post_updates/00001_simple_banner/core.entity_form_mode.paragraph.oe_banner_simple.yml @@ -8,4 +8,3 @@ label: 'Simple banner' description: '' targetEntityType: paragraph cache: true - diff --git a/modules/oe_theme_test/oe_theme_test.info.yml b/modules/oe_theme_test/oe_theme_test.info.yml index 864ecb145..4f6388a4e 100644 --- a/modules/oe_theme_test/oe_theme_test.info.yml +++ b/modules/oe_theme_test/oe_theme_test.info.yml @@ -3,7 +3,6 @@ type: module description: 'OpenEuropa theme test module.' package: OpenEuropa hidden: true -version: VERSION core_version_requirement: ^10 config_devel: diff --git a/oe_theme.theme b/oe_theme.theme index e04deac62..53b79676a 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1675,6 +1675,11 @@ function oe_theme_preprocess_paragraph__oe_banner(array &$variables): void { // Load needed images styles based on banner size. $image_style_storage = \Drupal::entityTypeManager()->getStorage('image_style'); + $full_width = NULL; + $extra_large = NULL; + $large = NULL; + $medium = NULL; + $small = NULL; if ($variables['size'] === 's') { $full_width = $image_style_storage->load('oe_theme_full_width_banner_5_1'); $extra_large = $image_style_storage->load('oe_theme_extra_large_5_1_banner'); @@ -2124,7 +2129,6 @@ function oe_theme_preprocess_paragraph__oe_illustration_list_images(array &$vari $language_id = $paragraph->language()->getId(); $sub_paragraph = $entity_repository->getTranslationFromContext($sub_paragraph, $language_id); // Get the image from attached media. - $image = []; $media = _oe_theme_prepare_media($sub_paragraph->get('field_oe_media')->entity, $variables['user'], $cacheability, $language_id); if ($media) { $thumbnail = ''; @@ -2232,6 +2236,11 @@ function oe_theme_preprocess_paragraph__oe_carousel(array &$variables): void { $variables['size'] = substr($paragraph->get('field_oe_carousel_size')->value, 0, 1); } // Load needed images styles based on carousel size. + $full_width = NULL; + $extra_large = NULL; + $large = NULL; + $medium = NULL; + $small = NULL; $image_style_storage = \Drupal::entityTypeManager()->getStorage('image_style'); if ($variables['size'] === 's') { $full_width = $image_style_storage->load('oe_theme_full_width_banner_5_1'); @@ -2261,7 +2270,6 @@ function oe_theme_preprocess_paragraph__oe_carousel(array &$variables): void { $sub_paragraph = \Drupal::service('entity.repository') ->getTranslationFromContext($sub_paragraph, $paragraph->language()->getId()); // Add CTA, Title and description if available. - $link = ''; $link_text = ''; if (!$sub_paragraph->get('field_oe_link')->isEmpty()) { /** @var \Drupal\link\Plugin\Field\FieldType\LinkItem $link_item */ diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 000000000..ca9247acf --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,2 @@ +includes: + - ./vendor/openeuropa/code-review-drupal/dist/phpstan.drupal.neon diff --git a/templates/patterns/link/link.ui_patterns.yml b/templates/patterns/link/link.ui_patterns.yml index e050a7974..ec7dd9a85 100644 --- a/templates/patterns/link/link.ui_patterns.yml +++ b/templates/patterns/link/link.ui_patterns.yml @@ -29,4 +29,4 @@ link: type: "array" label: "Contextual links" description: "Render array of contextual links" - preview: ~ \ No newline at end of file + preview: ~ diff --git a/templates/patterns/navigation_list/navigation_list.ui_patterns.yml b/templates/patterns/navigation_list/navigation_list.ui_patterns.yml index eec2a6a73..4e0ac55ec 100644 --- a/templates/patterns/navigation_list/navigation_list.ui_patterns.yml +++ b/templates/patterns/navigation_list/navigation_list.ui_patterns.yml @@ -77,4 +77,3 @@ navigation_list: preview: src: "https://loremflickr.com/1000/500/arch" alt: "Alternative text for image" - diff --git a/templates/patterns/tabs/tabs.ui_patterns.yml b/templates/patterns/tabs/tabs.ui_patterns.yml index 9cd7a9971..eac4455a0 100644 --- a/templates/patterns/tabs/tabs.ui_patterns.yml +++ b/templates/patterns/tabs/tabs.ui_patterns.yml @@ -36,4 +36,3 @@ tabs: label: 'Extra classes string' description: 'Extra classes string' preview: '' - diff --git a/tests/src/Functional/CorporateFooterRenderTest.php b/tests/src/Functional/CorporateFooterRenderTest.php index 8ca0a72fc..33da694b5 100644 --- a/tests/src/Functional/CorporateFooterRenderTest.php +++ b/tests/src/Functional/CorporateFooterRenderTest.php @@ -321,7 +321,7 @@ public function testCorporateFooterRendering(): void { $this->assertEquals('Discover more on europa.eu', trim($actual->getHtml())); // Assert presence of ecl logo in the standardised footer. - $this->assertEclLogoPresence($section, 'European Union'); + $this->assertEclLogoPresence($section); $column = $assert->elementExists('css', 'footer.ecl-site-footer div.ecl-site-footer__row:nth-child(2) div.ecl-site-footer__column:nth-child(2)'); $subsection = $assert->elementExists('css', '.ecl-site-footer__section:nth-child(1)', $column); diff --git a/tests/src/Kernel/ContactRenderTest.php b/tests/src/Kernel/ContactRenderTest.php index 289240829..db92981a9 100644 --- a/tests/src/Kernel/ContactRenderTest.php +++ b/tests/src/Kernel/ContactRenderTest.php @@ -26,6 +26,20 @@ class ContactRenderTest extends ContentRenderTestBase { 'oe_theme_content_entity_contact', ]; + /** + * The contact entity storage. + * + * @var \Drupal\Core\Entity\EntityStorageInterface + */ + protected $contactStorage; + + /** + * The contact view builder. + * + * @var \Drupal\Core\Entity\EntityViewBuilderInterface + */ + protected $contactViewBuilder; + /** * {@inheritdoc} */ diff --git a/tests/src/Kernel/StatusMessagesTest.php b/tests/src/Kernel/StatusMessagesTest.php index 07003de33..67d6b995f 100644 --- a/tests/src/Kernel/StatusMessagesTest.php +++ b/tests/src/Kernel/StatusMessagesTest.php @@ -89,7 +89,7 @@ public function testStatusMessages(array $data): void { $this->assertStringNotContainsString( $info['heading'], $html, - 'No messages of type "%s" are present, but the related heading "%s" was found.', $type, $info['heading'] + sprintf('No messages of type "%s" are present, but the related heading "%s" was found.', $type, $info['heading']) ); } diff --git a/tests/themes/oe_theme_subtheme_test/oe_theme_subtheme_test.info.yml b/tests/themes/oe_theme_subtheme_test/oe_theme_subtheme_test.info.yml index 0a188a023..b7d071d97 100755 --- a/tests/themes/oe_theme_subtheme_test/oe_theme_subtheme_test.info.yml +++ b/tests/themes/oe_theme_subtheme_test/oe_theme_subtheme_test.info.yml @@ -1,5 +1,4 @@ name: 'OpenEuropa Theme subtheme test' type: theme -version: VERSION core_version_requirement: ^10 base theme: oe_theme