File tree Expand file tree Collapse file tree 7 files changed +58
-35
lines changed
MediaGallerySynchronization/Model
lib/internal/Magento/Framework Expand file tree Collapse file tree 7 files changed +58
-35
lines changed Original file line number Diff line number Diff line change 55 */
66namespace Magento \Eav \Model \Attribute \Data ;
77
8- use Magento \Framework \Filesystem \DriverInterface ;
8+ use Magento \Framework \Filesystem \ExtendedDriverInterface ;
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 DriverInterface ;
32+ $ localStorage = !$ this ->_directory ->getDriver () instanceof ExtendedDriverInterface ;
3333 $ imageProp = $ localStorage
3434 ? @getimagesize ($ value ['tmp_name ' ])
3535 : $ this ->_directory ->getDriver ()->getMetadata ($ value ['tmp_name ' ]);
Original file line number Diff line number Diff 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 \DriverInterface ) {
78+ if ($ driver instanceof Filesystem \ExtendedDriverInterface ) {
7979 $ meta = $ driver ->getMetadata ($ absolutePath );
8080 } else {
8181 /**
Original file line number Diff line number Diff line change 77
88namespace Magento \RemoteStorage \Driver ;
99
10- use Magento \Framework \Filesystem \DriverInterface ;
10+ use Magento \Framework \Filesystem \ExtendedDriverInterface ;
1111
1212/**
1313 * Remote storage driver.
1414 */
15- interface RemoteDriverInterface extends DriverInterface
15+ interface RemoteDriverInterface extends ExtendedDriverInterface
1616{
1717 /**
1818 * Test storage connection.
Original file line number Diff line number Diff line change 1515 * Utility for mime type retrieval
1616 *
1717 * @deprecated
18- * @see Filesystem\DriverInterface ::getMetadata()
18+ * @see Filesystem\ExtendedDriverInterface ::getMetadata()
1919 */
2020class 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 \DriverInterface ) {
116+ if ($ driver instanceof Filesystem \ExtendedDriverInterface ) {
117117 return $ driver ->getMetadata ($ file )['mimetype ' ];
118118 }
119119
Original file line number Diff line number Diff 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 \DriverInterface ::class);
59+ $ this ->remoteDriverMock = $ this ->getMockForAbstractClass (Filesystem \ExtendedDriverInterface ::class);
6060
6161 $ this ->localDirectoryMock = $ this ->getMockForAbstractClass (Filesystem \Directory \WriteInterface::class);
6262 $ this ->localDirectoryMock ->method ('getDriver ' )
Original file line number Diff line number Diff line change @@ -393,31 +393,4 @@ 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 ;
423396}
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \Framework \Filesystem ;
9+
10+ use Magento \Framework \Exception \FileSystemException ;
11+
12+ /**
13+ * Provides extension for Driver interface.
14+ *
15+ * @see DriverInterface
16+ *
17+ * @deprecated Method will be moved to DriverInterface
18+ * @see DriverInterface
19+ */
20+ interface ExtendedDriverInterface extends DriverInterface
21+ {
22+ /**
23+ * Retrieve file metadata.
24+ *
25+ * Implementation must return associative array with next keys:
26+ *
27+ * ```
28+ * [
29+ * 'path',
30+ * 'dirname',
31+ * 'basename',
32+ * 'extension',
33+ * 'filename',
34+ * 'timestamp',
35+ * 'size',
36+ * 'mimetype',
37+ * 'extra' => [
38+ * 'image-width',
39+ * 'image-height'
40+ * ]
41+ * ];
42+ *
43+ * @param string $path Absolute path to file
44+ * @return array
45+ * @throws FileSystemException
46+ *
47+ * @deprecated Method will be moved to DriverInterface
48+ */
49+ public function getMetadata (string $ path ): array ;
50+ }
You can’t perform that action at this time.
0 commit comments