Skip to content

Commit 26aca75

Browse files
committed
#AC-10721::Investigate the league/flysystem Composer dependencies upgrading to latest version- refactoring for interface declaration
1 parent 4212b4f commit 26aca75

File tree

6 files changed

+41
-19
lines changed

6 files changed

+41
-19
lines changed

app/code/Magento/AwsS3/Driver/AwsS3.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Magento\Framework\Phrase;
2121
use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface;
2222
use Magento\RemoteStorage\Driver\DriverException;
23-
use Magento\RemoteStorage\Driver\RemoteDriverInterface;
23+
use Magento\RemoteStorage\Driver\ExtendedRemoteDriverInterface;
2424
use Psr\Log\LoggerInterface;
2525
use Throwable;
2626

@@ -30,7 +30,7 @@
3030
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
3131
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3232
*/
33-
class AwsS3 implements RemoteDriverInterface
33+
class AwsS3 implements ExtendedRemoteDriverInterface
3434
{
3535
public const TYPE_DIR = 'dir';
3636
public const TYPE_FILE = 'file';

app/code/Magento/AwsS3/Driver/AwsS3Factory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory;
1717
use Magento\RemoteStorage\Driver\DriverException;
1818
use Magento\RemoteStorage\Driver\DriverFactoryInterface;
19-
use Magento\RemoteStorage\Driver\RemoteDriverInterface;
19+
use Magento\RemoteStorage\Driver\ExtendedRemoteDriverInterface;
2020
use Magento\RemoteStorage\Model\Config;
2121

2222
/**
@@ -90,7 +90,7 @@ public function __construct(
9090
/**
9191
* @inheritDoc
9292
*/
93-
public function create(): RemoteDriverInterface
93+
public function create(): ExtendedRemoteDriverInterface
9494
{
9595
try {
9696
return $this->createConfigured(
@@ -141,7 +141,7 @@ public function createConfigured(
141141
string $prefix,
142142
string $cacheAdapter = '',
143143
array $cacheConfig = []
144-
): RemoteDriverInterface {
144+
): ExtendedRemoteDriverInterface {
145145
$config = $this->prepareConfig($config);
146146
$client = new S3Client($config);
147147
$adapter = new AwsS3V3Adapter($client, $config['bucket'], $prefix);

app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ interface DriverFactoryInterface
1616
/**
1717
* Creates driver from stored config.
1818
*
19-
* @return RemoteDriverInterface
19+
* @return ExtendedRemoteDriverInterface
2020
*
2121
* @throws DriverException
2222
*/
23-
public function create(): RemoteDriverInterface;
23+
public function create(): ExtendedRemoteDriverInterface;
2424

2525
/**
2626
* Creates driver from config.
@@ -29,7 +29,7 @@ public function create(): RemoteDriverInterface;
2929
* @param string $prefix
3030
* @param string $cacheAdapter
3131
* @param array $cacheConfig
32-
* @return RemoteDriverInterface
32+
* @return ExtendedRemoteDriverInterface
3333
*
3434
* @throws DriverException
3535
*/
@@ -38,5 +38,5 @@ public function createConfigured(
3838
string $prefix,
3939
string $cacheAdapter = '',
4040
array $cacheConfig = []
41-
): RemoteDriverInterface;
41+
): ExtendedRemoteDriverInterface;
4242
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Copyright 2023 Adobe
4+
* All Rights Reserved.
5+
*
6+
* NOTICE: All information contained herein is, and remains
7+
* the property of Adobe and its suppliers, if any. The intellectual
8+
* and technical concepts contained herein are proprietary to Adobe
9+
* and its suppliers and are protected by all applicable intellectual
10+
* property laws, including trade secret and copyright laws.
11+
* Dissemination of this information or reproduction of this material
12+
* is strictly forbidden unless prior written permission is obtained from
13+
* Adobe.
14+
*/
15+
declare(strict_types=1);
16+
17+
namespace Magento\RemoteStorage\Driver;
18+
19+
use Magento\RemoteStorage\Driver\RemoteDriverInterface;
20+
21+
interface ExtendedRemoteDriverInterface extends RemoteDriverInterface
22+
{
23+
/**
24+
* To check if directory exists
25+
*
26+
* @param string $path
27+
* @return bool
28+
*/
29+
public function isDirectoryExists($path): bool;
30+
}

app/code/Magento/RemoteStorage/Driver/RemoteDriverInterface.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,4 @@ interface RemoteDriverInterface extends ExtendedDriverInterface
2121
* @throws DriverException
2222
*/
2323
public function test(): void;
24-
25-
/**
26-
* To check if directory exists
27-
*
28-
* @param string $path
29-
* @return bool
30-
*/
31-
public function isDirectoryExists($path): bool;
3224
}

app/code/Magento/RemoteStorage/Test/Unit/Setup/ConfigOptionsListTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\RemoteStorage\Driver\DriverFactoryInterface;
1212
use Magento\RemoteStorage\Driver\DriverFactoryPool;
13-
use Magento\RemoteStorage\Driver\RemoteDriverInterface;
13+
use Magento\RemoteStorage\Driver\ExtendedRemoteDriverInterface;
1414
use Magento\RemoteStorage\Setup\ConfigOptionsList;
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
@@ -86,7 +86,7 @@ public function testValidate(array $input, bool $isDeploymentConfigExists, array
8686
->with($input['remote-storage-driver'])
8787
->willReturn($driverFactoryMock);
8888

89-
$remoteDriverMock = $this->getMockBuilder(RemoteDriverInterface::class)
89+
$remoteDriverMock = $this->getMockBuilder(ExtendedRemoteDriverInterface::class)
9090
->disableOriginalConstructor()
9191
->getMock();
9292

0 commit comments

Comments
 (0)