- Issue created by @HitchShock
- First commit to issue fork.
- Assigned to sourabhjain
- Issue was unassigned.
- Status changed to Needs work
4 months ago 12:15pm 4 March 2024 - 🇮🇳India sourabhjain
Below are the PHPSTAN errors
PHP Warning: Undefined global variable $base_path in /var/www/html/drupal10/web/core/includes/common.inc on line 161 Warning: Undefined global variable $base_path in /var/www/html/drupal10/web/core/includes/common.inc on line 161 5/5 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ ---------------------------------------------------------------------------------------------------------------------------------------- Line src/PDFToImageBatchHelper.php ------ ---------------------------------------------------------------------------------------------------------------------------------------- 117 Parameter $pdf of method Drupal\pdf_to_imagefield\PDFToImageBatchHelper::generateProcessPage() has invalid type Spatie\PdfToImage\Pdf. 133 Parameter $pdf of method Drupal\pdf_to_imagefield\PDFToImageBatchHelper::generatePage() has invalid type Spatie\PdfToImage\Pdf. ------ ---------------------------------------------------------------------------------------------------------------------------------------- ------ --------------------------------------------------------------------- Line src/PDFToImageManager.php ------ --------------------------------------------------------------------- 169 Instantiated class Spatie\PdfToImage\Pdf not found. 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols ------ --------------------------------------------------------------------- ------ ----------------------------------------------------------------------------------- Line src/Plugin/Field/FieldWidget/PDFToImageWidget.php ------ ----------------------------------------------------------------------------------- 64 Unsafe usage of new static(). 💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static ------ -----------------------------------------------------------------------------------
I just investigated on the above and it showing imagick extension is missing as per https://github.com/spatie/pdf-to-image/issues/145
- 🇺🇦Ukraine HitchShock Ukraine
Hi @sourabhjain
Seems like php extension doesn't exist only on your local env, that's why you have such PHPStan errors.
According to
https://git.drupalcode.org/project/pdf_to_imagefield/-/jobs/947631
https://git.drupalcode.org/issue/pdf_to_imagefield-3425194/-/jobs/976016
there is only one PHPStan error------ ------------------------------------------------------------------------------ Line src/Plugin/Field/FieldWidget/PDFToImageWidget.php ------ ------------------------------------------------------------------------------ 64 Unsafe usage of new static(). 💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static ------ ------------------------------------------------------------------------------