diff --git a/core/lib/Drupal/Core/File/UnmanagedFileHandler.php b/core/lib/Drupal/Core/File/UnmanagedFileHandler.php index c06c6e6..843f635 100644 --- a/core/lib/Drupal/Core/File/UnmanagedFileHandler.php +++ b/core/lib/Drupal/Core/File/UnmanagedFileHandler.php @@ -6,7 +6,6 @@ use Drupal\Core\File\Exception\FileException; use Drupal\Core\File\Exception\FileExistsException; use Drupal\Core\File\Exception\FileNotExistsException; -use Drupal\Core\File\FileHandlerInterface; /** * Implements service for low-level unhandled file operations. @@ -33,7 +32,7 @@ public function __construct(FileSystemInterface $file_system) { /** * {@inheritdoc} */ - public function copy($source, $destination, $replace = FileSystemInterface::FILE_EXISTS_RENAME) { + public function copy($source, $destination, $replace = self::FILE_EXISTS_RENAME) { $this->prepare($source, $destination, $replace); // Perform the copy operation. @@ -52,8 +51,7 @@ public function copy($source, $destination, $replace = FileSystemInterface::FILE } /** - * Internal function that prepares the destination for a file_unmanaged_copy or - * file_unmanaged_move operation. + * Prepares the destination for a file copy or move operation. * * - Checks if $source and $destination are valid and readable/writable. * - Checks that $source is not equal to $destination; if they are an error @@ -63,7 +61,7 @@ public function copy($source, $destination, $replace = FileSystemInterface::FILE * * @internal * This public method is marked internal in 8.3.x and will be - * converted into private method before 9.0.0. + * converted into protected method before 9.0.0. * * @param $source * A string specifying the filepath or URI of the source file. @@ -82,14 +80,21 @@ public function copy($source, $destination, $replace = FileSystemInterface::FILE * @return void * * @throws \Drupal\Core\File\Exception\DirectoryNotReadyException + * When the destination directory is not properly configured. + * * @throws \Drupal\Core\File\Exception\FileException + * When the source and destination are the same file. + * * @throws \Drupal\Core\File\Exception\FileExistsException + * When a file by that name already exists in the destination directory. + * * @throws \Drupal\Core\File\Exception\FileNotExistsException + * When the source file does not exist. * * @see \Drupal\Core\File\UnmanagedFileHandler::copy() * @see \Drupal\Core\File\UnmanagedFileHandler::move() */ - public function prepare($source, &$destination = NULL, $replace = FileSystemInterface::FILE_EXISTS_RENAME) { + public function prepare($source, &$destination = NULL, $replace = self::FILE_EXISTS_RENAME) { $original_source = $source; // Assert that the source file actually exists. diff --git a/core/lib/Drupal/Core/File/UnmanagedFileHandlerInterface.php b/core/lib/Drupal/Core/File/UnmanagedFileHandlerInterface.php index e418cbd..248d6ca 100644 --- a/core/lib/Drupal/Core/File/UnmanagedFileHandlerInterface.php +++ b/core/lib/Drupal/Core/File/UnmanagedFileHandlerInterface.php @@ -46,9 +46,7 @@ * @throws \Drupal\Core\File\Exception\FileException * @throws \Drupal\Core\File\Exception\FileExistsException * @throws \Drupal\Core\File\Exception\FileNotExistsException - * - * @see file_copy() */ - public function copy($source, $destination, $replace = FileHandlerInterface::FILE_EXISTS_RENAME); + public function copy($source, $destination, $replace = self::FILE_EXISTS_RENAME); }