Skip to content

Commit 5292a03

Browse files
committed
B2B-2028: [AWS S3] [Integration Tests]: Investigate Test Failures in CustomerCustomAttributes module
1 parent 6115978 commit 5292a03

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

app/code/Magento/RemoteStorage/Model/File/Uploader.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,27 @@ class Uploader extends \Magento\Framework\File\Uploader
3434
/**
3535
* Copies file to the tmp directory if remote storage is enabled and tmp file is located on remote storage
3636
*
37-
* {@inheritDoc}
37+
* @param string|array $fileId
38+
* @param Mime|null $fileMime
39+
* @param DirectoryList|null $directoryList
40+
* @param DriverPool|null $driverPool
41+
* @param TargetDirectory|null $targetDirectory
42+
* @param Filesystem|null $filesystem
43+
* @param Config|null $config
44+
* @throws \DomainException
3845
*/
3946
public function __construct(
4047
$fileId,
4148
Mime $fileMime = null,
4249
DirectoryList $directoryList = null,
4350
DriverPool $driverPool = null,
4451
TargetDirectory $targetDirectory = null,
45-
Filesystem $filesystem = null
52+
Filesystem $filesystem = null,
53+
Config $config = null
4654
) {
4755
$targetDirectory = $targetDirectory ?: ObjectManager::getInstance()->get(TargetDirectory::class);
4856
$filesystem = $filesystem ?: ObjectManager::getInstance()->get(FileSystem::class);
49-
$config = ObjectManager::getInstance()->get(Config::class);
57+
$config = $config ?: ObjectManager::getInstance()->get(Config::class);
5058

5159
if ($config->isEnabled() && isset($fileId['tmp_name'])) {
5260
$this->tmpDirectoryWrite = $filesystem->getDirectoryWrite(DirectoryList::TMP);
@@ -70,6 +78,7 @@ private function copyFileToTmp(string $filePath): string
7078
$absolutePath = $this->remoteDirectoryWrite->getAbsolutePath($filePath);
7179
if ($this->remoteDirectoryWrite->isFile($absolutePath)) {
7280
$this->tmpDirectoryWrite->create();
81+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
7382
$tmpPath = $this->tmpDirectoryWrite->getAbsolutePath() . basename($filePath);
7483
$content = $this->remoteDirectoryWrite->getDriver()->fileGetContents($filePath);
7584
$this->tmpDirectoryWrite->getDriver()->filePutContents($tmpPath, $content);

0 commit comments

Comments
 (0)