Commit 17494fce authored by Nikolay Grachev's avatar Nikolay Grachev
Browse files

Resolve #3300655,#3300662: Drupal coding standard issues

parent 23837aee
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
<?php

/**
 * @file
 * Contains file_rename.module.
 */

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\file\FileInterface;
+8 −2
Original line number Diff line number Diff line
@@ -109,7 +109,10 @@ class FileRenameForm extends ContentEntityForm {
      $filepath_new = $this->getRenamedFilePath($form_state);
      // Rename existing file.
      $this->fileSystem->move($this->entity->getFileUri(), $filepath_new, FileSystemInterface::EXISTS_REPLACE);
      $log_args = ['@old' => $this->entity->getFilename(), '@new' => $filename_new];
      $log_args = [
        '@old' => $this->entity->getFilename(),
        '@new' => $filename_new,
      ];
      // Invoke pre-rename hooks.
      $this->moduleHandler->invokeAll('file_prerename', [$this->entity]);
      // Update file entity.
@@ -126,6 +129,9 @@ class FileRenameForm extends ContentEntityForm {
    }
  }

  /**
   * Get Renamed File Path.
   */
  protected function getRenamedFilePath(FormStateInterface $form_state) {
    $pathinfo = pathinfo($this->entity->getFileUri());
    $old_filename = $pathinfo['filename'];
+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.