- Issue created by @tunic
- 🇪🇸Spain tunic Madrid
phpstan errors and phpcs errors are standard code errors and can be easily fixed.
However, cpsell is more tricky. The typos must be fixed, but words like "commandfile" are legit so we have to instruct cspell to ginore certain words that are not typos.
For this, we need to create a .
cspell.json
file (see https://project.pages.drupalcode.org/gitlab_templates/jobs/cspell/) with this content.variables: _CSPELL_WORDS: 'commandfile'
- 🇪🇸Spain tunic Madrid
There's an error from phpstan tan I can't fix.
The problem is:
------ ------------------------------------------------------------------------ Line modules/image_styles_generator_webp/src/DerivativeWebpWarmer.php ------ ------------------------------------------------------------------------ 31 Parameter $webp of method Drupal\image_styles_generator_webp\DerivativeWebpWarmer::__construct() has invalid type Drupal\webp\Webp. ------ ------------------------------------------------------------------------
And in line 31 we can see:
public function __construct(LoggerInterface $logger, Webp $webp) {
We can expand the header:
/** * Constructs a Regenerator object. * * @param \Psr\Log\LoggerInterface $logger * The logger channel to log all info. * @param \Drupal\webp\Webp $webp * The webp service. */ public function __construct(LoggerInterface $logger, Webp $webp) {
And check that at the beginning of the file there's a
use
statement.use Drupal\webp\Webp;
The Webp class if from another module (the Webp module) but it is declared in the dependencies of the image_styles_generator_webp submodule.
- 🇪🇸Spain tunic Madrid
It seems the problem with phpstan is a bug in the Gitlab CI templates, see 🐛 Dependencies in submodules are not taken into account Active .
- 🇪🇸Spain tunic Madrid
IT seems there's a workaround: https://www.drupal.org/project/gitlab_templates/issues/3518843#comment-1... 🐛 Dependencies in submodules are not taken into account Active .
Automatically closed - issue fixed for 2 weeks with no activity.