Commit d13125c4 authored by Malgoroth's avatar Malgoroth Committed by Florent Torregrosa
Browse files

Issue #3249405 by Malgoroth, Grimreaper: Phpstan Errors Fix

parent ada159e2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ use Drupal\Core\Form\FormStateInterface;
/**
 * Implements template_preprocess_image_formatter().
 */
function animated_gif_preprocess_image_formatter(&$variables) {
function animated_gif_preprocess_image_formatter(array &$variables) : void {
  $image = $variables['item'];
  $imageValues = $image->getValue();
  $file = File::load($imageValues['target_id']);
@@ -29,7 +29,7 @@ function animated_gif_preprocess_image_formatter(&$variables) {
/**
 * Implements template_preprocess_responsive_image_formatter().
 */
function animated_gif_preprocess_responsive_image_formatter(&$variables) {
function animated_gif_preprocess_responsive_image_formatter(array &$variables) : void {
  $image = $variables['item'];
  $imageValues = $image->getValue();
  $file = File::load($imageValues['target_id']);
@@ -44,7 +44,7 @@ function animated_gif_preprocess_responsive_image_formatter(&$variables) {
/**
 * Implements template_preprocess_image_style().
 */
function animated_gif_preprocess_image_style(&$variables) {
function animated_gif_preprocess_image_style(array &$variables) : void {
  // File entity ID is not available here so we need to load it by URI.
  $files = \Drupal::entityTypeManager()
    ->getStorage('file')
@@ -68,7 +68,7 @@ function animated_gif_preprocess_image_style(&$variables) {
/**
 * Implements template_preprocess_responsive_image().
 */
function animated_gif_preprocess_responsive_image(&$variables) {
function animated_gif_preprocess_responsive_image(array &$variables) : void {
  // File entity ID is not available here so we need to load it by URI.
  $files = \Drupal::entityTypeManager()
    ->getStorage('file')
@@ -90,7 +90,7 @@ function animated_gif_preprocess_responsive_image(&$variables) {
/**
 * Implements hook_field_widget_WIDGET_TYPE_form_alter().
 */
function animated_gif_field_widget_image_image_form_alter(&$element, FormStateInterface $form_state, $context) {
function animated_gif_field_widget_image_image_form_alter(array &$element, FormStateInterface $form_state, array $context) : void {
  if (!empty($element['#default_value']['fids'])) {
    $fid = reset($element['#default_value']['fids']);
    $file = File::load($fid);