You are here

protected function AvatarKitDownloadUtility::moveFile in Avatar Kit 8.2

Abstraction of file_unmanaged_move.

Parameters

array ...: Arguments to pass to file_unmanaged_move().

Return value

string The path to the new file.

Throws

\Exception Throws exception in the event of an error.

See also

\file_unmanaged_move();

1 call to AvatarKitDownloadUtility::moveFile()
AvatarKitDownloadUtility::createFile in src/AvatarKitDownloadUtility.php
Creates a file entity from a PSR response.

File

src/AvatarKitDownloadUtility.php, line 157

Class

AvatarKitDownloadUtility
Utility for creating Drupal files from responses.

Namespace

Drupal\avatars

Code

protected function moveFile(...$args) : string {
  $result = \file_unmanaged_move(...$args);
  if ($result === FALSE) {
    throw new \Exception('Failed to move file.');
  }
  return $result;
}