Skip to content

Commit dc238bb

Browse files
committed
lib/internal/Magento/Framework/Filesystem/ExtendedDriverInterface.php was removed. getMetadata method was movet to lib/internal/Magento/Framework/Filesystem/DriverInterface
1 parent 0ff1a03 commit dc238bb

File tree

7 files changed

+35
-58
lines changed

7 files changed

+35
-58
lines changed

app/code/Magento/Eav/Model/Attribute/Data/Image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Eav\Model\Attribute\Data;
77

8-
use Magento\Framework\Filesystem\ExtendedDriverInterface;
8+
use Magento\Framework\Filesystem\DriverInterface;
99

1010
/**
1111
* EAV Entity Attribute Image File Data Model
@@ -29,7 +29,7 @@ protected function _validateByRules($value)
2929
{
3030
$label = __($this->getAttribute()->getStoreLabel());
3131
$rules = $this->getAttribute()->getValidateRules();
32-
$localStorage = !$this->_directory->getDriver() instanceof ExtendedDriverInterface;
32+
$localStorage = !$this->_directory->getDriver() instanceof DriverInterface;
3333
$imageProp = $localStorage
3434
? @getimagesize($value['tmp_name'])
3535
: $this->_directory->getDriver()->getMetadata($value['tmp_name']);

app/code/Magento/MediaGallerySynchronization/Model/CreateAssetFromFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function execute(string $path): AssetInterface
7575
$absolutePath = $this->getMediaDirectory()->getAbsolutePath($path);
7676
$driver = $this->getMediaDirectory()->getDriver();
7777

78-
if ($driver instanceof Filesystem\ExtendedDriverInterface) {
78+
if ($driver instanceof Filesystem\DriverInterface) {
7979
$meta = $driver->getMetadata($absolutePath);
8080
} else {
8181
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
namespace Magento\RemoteStorage\Driver;
99

10-
use Magento\Framework\Filesystem\ExtendedDriverInterface;
10+
use Magento\Framework\Filesystem\DriverInterface;
1111

1212
/**
1313
* Remote storage driver.
1414
*/
15-
interface RemoteDriverInterface extends ExtendedDriverInterface
15+
interface RemoteDriverInterface extends DriverInterface
1616
{
1717
/**
1818
* Test storage connection.

lib/internal/Magento/Framework/File/Mime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Utility for mime type retrieval
1616
*
1717
* @deprecated
18-
* @see Filesystem\ExtendedDriverInterface::getMetadata()
18+
* @see Filesystem\DriverInterface::getMetadata()
1919
*/
2020
class Mime
2121
{
@@ -113,7 +113,7 @@ public function getMimeType($file)
113113
throw new FileSystemException(__("File '$file' doesn't exist"));
114114
}
115115

116-
if ($driver instanceof Filesystem\ExtendedDriverInterface) {
116+
if ($driver instanceof Filesystem\DriverInterface) {
117117
return $driver->getMetadata($file)['mimetype'];
118118
}
119119

lib/internal/Magento/Framework/File/Test/Unit/MimeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MimeTest extends TestCase
5656
protected function setUp(): void
5757
{
5858
$this->localDriverMock = $this->getMockForAbstractClass(Filesystem\DriverInterface::class);
59-
$this->remoteDriverMock = $this->getMockForAbstractClass(Filesystem\ExtendedDriverInterface::class);
59+
$this->remoteDriverMock = $this->getMockForAbstractClass(Filesystem\DriverInterface::class);
6060

6161
$this->localDirectoryMock = $this->getMockForAbstractClass(Filesystem\Directory\WriteInterface::class);
6262
$this->localDirectoryMock->method('getDriver')

lib/internal/Magento/Framework/Filesystem/DriverInterface.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,4 +393,31 @@ public function getRealPathSafety($path);
393393
* @return mixed
394394
*/
395395
public function getRelativePath($basePath, $path = null);
396+
397+
/**
398+
* Retrieve file metadata.
399+
*
400+
* Implementation must return associative array with next keys:
401+
*
402+
* ```
403+
* [
404+
* 'path',
405+
* 'dirname',
406+
* 'basename',
407+
* 'extension',
408+
* 'filename',
409+
* 'timestamp',
410+
* 'size',
411+
* 'mimetype',
412+
* 'extra' => [
413+
* 'image-width',
414+
* 'image-height'
415+
* ]
416+
* ];
417+
*
418+
* @param string $path Absolute path to file
419+
* @return array
420+
* @throws FileSystemException
421+
*/
422+
public function getMetadata(string $path): array;
396423
}

lib/internal/Magento/Framework/Filesystem/ExtendedDriverInterface.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)