Fatal error: Declaration of Drupal\swagger_ui_formatter\Plugin\Field\FieldFormatter\SwaggerUIFileFormatter::getSwaggerFileUrlFromField(Drupal\Core\Field\FieldItemInterface $field_item, array $context = []) must be compatible with Drupal\swagger_ui_formatter\Plugin\Field\FieldFormatter\SwaggerUIFormatterTrait::getSwaggerFileUrlFromField(Drupal\Core\Field\FieldItemInterface $field_item, array $context = []): ?string in ..../web/modules/contrib/swagger_ui_formatter/src/Plugin/Field/FieldFormatter/SwaggerUIFileFormatter.php on line 128
I added :?string on line 128 of SwaggerUIFileFormatter.php after the declaration of the function and everything works fine now.
Hello,
I've got this error using thig module :
Fatal error: Declaration of Drupal\swagger_ui_formatter\Plugin\Field\FieldFormatter\SwaggerUIFileFormatter::getSwaggerFileUrlFromField(Drupal\Core\Field\FieldItemInterface $field_item, array $context = []) must be compatible with Drupal\swagger_ui_formatter\Plugin\Field\FieldFormatter\SwaggerUIFormatterTrait::getSwaggerFileUrlFromField(Drupal\Core\Field\FieldItemInterface $field_item, array $context = []): ?string in ..../web/modules/contrib/swagger_ui_formatter/src/Plugin/Field/FieldFormatter/SwaggerUIFileFormatter.php on line 128
I added
:?string
on line 128 of SwaggerUIFileFormatter.php after the declaration of the function and everything works fine now.