diff -u b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php --- b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php +++ b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php @@ -3,23 +3,12 @@ namespace Drupal\file\Plugin\migrate\destination; use Drupal\Component\Utility\Unicode; -use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Field\FieldTypePluginManagerInterface; use Drupal\Core\Field\Plugin\Field\FieldType\UriItem; -use Drupal\Core\File\FileSystemInterface; -use Drupal\Core\StreamWrapper\LocalStream; -use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; -use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; -use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Every migration that uses this destination must have an optional - * dependency on the d6_file migration to ensure it runs first. - * * @MigrateDestination( * id = "entity:file" * ) diff -u b/core/modules/file/src/Plugin/migrate/process/FileCopy.php b/core/modules/file/src/Plugin/migrate/process/FileCopy.php --- b/core/modules/file/src/Plugin/migrate/process/FileCopy.php +++ b/core/modules/file/src/Plugin/migrate/process/FileCopy.php @@ -13,7 +13,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Process the file url into a D8 compatible URL. + * Copy a file from one place into another. * * @MigrateProcessPlugin( * id = "file_copy" @@ -109,7 +109,7 @@ * (optional) FILE_EXISTS_REPLACE (default) or FILE_EXISTS_RENAME. * * @return bool - * TRUE on success, FALSE on failure. + * TRUE on success, FALSE on failure. */ protected function writeFile($source, $destination, $replace = FILE_EXISTS_REPLACE) { if ($this->configuration['move']) { @@ -124,13 +124,11 @@ /** * Determines how to handle file conflicts. * - * @param \Drupal\migrate\Row $row - * * @return int * Either FILE_EXISTS_REPLACE (default) or FILE_EXISTS_RENAME, depending * on the current configuration. */ - protected function getOverwriteMode(Row $row) { + protected function getOverwriteMode() { if (!empty($this->configuration['rename'])) { return FILE_EXISTS_RENAME; } @@ -148,8 +146,8 @@ * The URI or path. * * @return string|false - * The directory component of the path or URI, or FALSE if it could not - * be determined. + * The directory component of the path or URI, or FALSE if it could not + * be determined. */ protected function getDirectory($uri) { $dir = $this->fileSystem->dirname($uri); @@ -162,7 +160,8 @@ } /** - * Returns if the source and destination URIs represent identical paths. + * Determines if the source and destination URIs represent identical paths. + * * If either URI is a remote stream, will return FALSE. * * @param string $source @@ -171,8 +170,8 @@ * The destination URI. * * @return bool - * TRUE if the source and destination URIs refer to the same physical path, - * otherwise FALSE. + * TRUE if the source and destination URIs refer to the same physical path, + * otherwise FALSE. */ protected function isLocationUnchanged($source, $destination) { if ($this->isLocalUri($source) && $this->isLocalUri($destination)) { @@ -184,7 +183,7 @@ } /** - * Returns if the given URI or path is considered local. + * Determines if the given URI or path is considered local. * * A URI or path is considered local if it either has no scheme component, * or the scheme is implemented by a stream wrapper which extends diff -u b/core/modules/file/src/Plugin/migrate/process/Urlencode.php b/core/modules/file/src/Plugin/migrate/process/Urlencode.php --- b/core/modules/file/src/Plugin/migrate/process/Urlencode.php +++ b/core/modules/file/src/Plugin/migrate/process/Urlencode.php @@ -13,20 +13,20 @@ * id = "urlencode" * ) */ -class Urlencode extends ProcessPluginBase{ +class Urlencode extends ProcessPluginBase { /** * {@inheritdoc} */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - // Only apply to a full URL + // Only apply to a full URL. if (strpos($value, '://')) { $components = explode('/', $value); foreach ($components as $key => $component) { $components[$key] = rawurlencode($component); } $value = implode('/', $components); - // Actually, we don't want certain characters encoded + // Actually, we don't want certain characters encoded. $value = str_replace('%3A', ':', $value); $value = str_replace('%3F', '?', $value); $value = str_replace('%26', '&', $value); diff -u b/core/modules/file/tests/src/Unit/Plugin/migrate/process/UrlencodeTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/process/UrlencodeTest.php --- b/core/modules/file/tests/src/Unit/Plugin/migrate/process/UrlencodeTest.php +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/process/UrlencodeTest.php @@ -42,7 +42,7 @@ /** * Perform the urlencode process plugin over the given value. * - * @param $value + * @param string $value * Url to be encoded. * * @return string