Problem/Motivation
The latest build pipelines seem to be failing with validation errors for the PHPSTAN and PHPUNIT (next minor) jobs, see:
https://git.drupalcode.org/project/image_link_formatter/-/pipelines/668964
PHPSTAN errors:
------ -----------------------------------------------------------------------
Line src/Plugin/Field/FieldFormatter/ImageLinkFormatterTrait.php (in
context of class
Drupal\image_link_formatter\Plugin\Field\FieldFormatter\ImageLinkForm
atter)
------ -----------------------------------------------------------------------
69 Possibly invalid array key type mixed.
🪪 offsetAccess.invalidOffset
70 Possibly invalid array key type mixed.
🪪 offsetAccess.invalidOffset
85 Possibly invalid array key type mixed.
🪪 offsetAccess.invalidOffset
------ -----------------------------------------------------------------------
phpunit (next minor):
Responsive Image Link Formatter (Drupal\Tests\responsive_image_link_formatter\Kernel\ResponsiveImageLinkFormatter)
✘ Image formatter cache tags
┐
├ Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "Drupal\responsive_image\Hook\ResponsiveImageThemeHooks": argument "$breakpointManager" of method "__construct()" references interface "Drupal\breakpoint\BreakpointManagerInterface" but no such service exists. Did you create an instantiable class that implements this interface?
│
│ /builds/project/image_link_formatter/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php:48
│ /builds/project/image_link_formatter/vendor/symfony/dependency-injection/Compiler/Compiler.php:73
│ /builds/project/image_link_formatter/vendor/symfony/dependency-injection/ContainerBuilder.php:820
│ /builds/project/image_link_formatter/web/core/lib/Drupal/Core/DrupalKernel.php:1519
│ /builds/project/image_link_formatter/web/core/lib/Drupal/Core/DrupalKernel.php:1028
│ /builds/project/image_link_formatter/web/core/lib/Drupal/Core/DrupalKernel.php:524
│ /builds/project/image_link_formatter/web/core/tests/Drupal/KernelTests/KernelTestBase.php:360
│ /builds/project/image_link_formatter/web/core/tests/Drupal/KernelTests/KernelTestBase.php:239
│ /builds/project/image_link_formatter/web/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php:55
│ /builds/project/image_link_formatter/web/core/modules/image/tests/src/Kernel/ImageFormatterTest.php:55
│ /builds/project/image_link_formatter/tests/src/Traits/Kernel/ImageLinkFormatterTestTrait.php:51
┴
Steps to reproduce
Run build pipeline for the branch 2.2.x at:
https://git.drupalcode.org/project/image_link_formatter/-/pipelines
Proposed resolution
Fix all reported issues.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #4
dydave commentedFixed the PHPSTAN issues first by adding an explicit type to the variables.
Fixed also compatibility issues of the 'responsive_image_link_formatter' Kernel tests with Drupal core 11.3.x.
It seems the dependencies need to be explicitly declared in modules tests class.
The changes were merged above at #3 and the dev pipelines are back to passing 🟢 \o/
https://git.drupalcode.org/project/image_link_formatter/-/pipelines/669062
Marking issue as Fixed for now.
Thanks!