Pronovix / swagger_ui_formatter

Swagger UI Field Formatter for Drupal
GNU General Public License v2.0
3 stars 12 forks source link

PHP 8.0 support #81

Closed mxr576 closed 2 years ago

mxr576 commented 2 years ago

Possibly this is blocked by some dev dependencies that do not support PHP 8.0 yet, need validation. Although, maybe that is not a blocker either, because we can run certain QA checks with PHP 7.4 and the test suite with PHP 8.0 on the CI.

johnvenpin commented 2 years ago

Hello All,

Seem to be getting the following error with the swagger_ui_formatter module when using PHP 8 with Drupal 9.3.14. Any page that uses the swagger_ui_formatter fails with a 500 error. Everything is fine with PHP 7.4 - Please can you investigate.

php-error staging-27120 [07-Jun-2022 11:06:22 Europe/London] PHP Fatal error: Declaration of Drupal\swagger_ui_formatter\Plugin\Field\FieldFormatter\SwaggerUILinkFormatter::getSwaggerFileUrlFromField() must be compatible with Drupal\swagger_ui_formatter\Plugin\Field\FieldFormatter\SwaggerUIFormatterTrait::getSwaggerFileUrlFromField(Drupal\Core\Field\FieldItemInterface $field_item, array $context = []): ?string in /mnt/www/html/fildev/docroot/modules/contrib/swagger_ui_formatter/src/Plugin/Field/FieldFormatter/SwaggerUILinkFormatter.php on line 110 request_id="v-7bb4401c-e649-11ec-bc29-2bf437e63d97"

mxr576 commented 2 years ago

@johnvenpin thanks for reporting, feel free to open a PR with a fix, should be an easy one.