File tree Expand file tree Collapse file tree 5 files changed +29
-18
lines changed Expand file tree Collapse file tree 5 files changed +29
-18
lines changed Original file line number Diff line number Diff line change 12
12
/**
13
13
* Media gallery directory config
14
14
*/
15
- class Config
15
+ class Config implements ConfigInterface
16
16
{
17
17
private const XML_PATH_BLACKLIST_PATTERNS = 'blacklist/patterns ' ;
18
18
@@ -29,25 +29,13 @@ public function __construct(DataInterface $data)
29
29
$ this ->data = $ data ;
30
30
}
31
31
32
- /**
33
- * Get config value by key.
34
- *
35
- * @param string|null $key
36
- * @param string|null $default
37
- * @return array
38
- */
39
- public function get ($ key = null , $ default = null )
40
- {
41
- return $ this ->data ->get ($ key , $ default );
42
- }
43
-
44
32
/**
45
33
* Returns list of blacklist regexp patterns
46
34
*
47
35
* @return array
48
36
*/
49
37
public function getBlacklistPatterns () : array
50
38
{
51
- return $ this ->get (self ::XML_PATH_BLACKLIST_PATTERNS );
39
+ return $ this ->data -> get (self ::XML_PATH_BLACKLIST_PATTERNS );
52
40
}
53
41
}
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 \MediaGallery \Model \Directory ;
9
+
10
+ /**
11
+ * Media gallery directory config
12
+ */
13
+ interface ConfigInterface
14
+ {
15
+ /**
16
+ * Returns list of blacklist RegEx patterns
17
+ *
18
+ * @return array
19
+ */
20
+ public function getBlacklistPatterns (): array ;
21
+ }
Original file line number Diff line number Diff line change 15
15
class IsBlacklisted implements IsPathBlacklistedInterface
16
16
{
17
17
/**
18
- * @var Config
18
+ * @var ConfigInterface
19
19
*/
20
20
private $ config ;
21
21
22
22
/**
23
- * @param Config $config
23
+ * @param ConfigInterface $config
24
24
*/
25
- public function __construct (Config $ config )
25
+ public function __construct (ConfigInterface $ config )
26
26
{
27
27
$ this ->config = $ config ;
28
28
}
Original file line number Diff line number Diff line change 10
10
<preference for =" Magento\MediaGalleryApi\Api\Data\AssetInterface" type =" Magento\MediaGallery\Model\Asset" />
11
11
<preference for =" Magento\MediaGalleryApi\Api\Data\AssetKeywordsInterface" type =" Magento\MediaGallery\Model\AssetKeywords" />
12
12
13
+ <preference for =" Magento\MediaGallery\Model\Directory\ConfigInterface" type =" Magento\MediaGallery\Model\Directory\Config" />
14
+
13
15
<preference for =" Magento\MediaGalleryApi\Model\Asset\Command\GetByIdInterface" type =" Magento\MediaGallery\Model\Asset\Command\GetById" />
14
16
<preference for =" Magento\MediaGalleryApi\Model\Asset\Command\SaveInterface" type =" Magento\MediaGallery\Model\Asset\Command\Save" />
15
17
<preference for =" Magento\MediaGalleryApi\Model\Asset\Command\GetByPathInterface" type =" Magento\MediaGallery\Model\Asset\Command\GetByPath" />
Original file line number Diff line number Diff line change 29
29
<xs : complexType name =" patternsType" >
30
30
<xs : annotation >
31
31
<xs : documentation >
32
- List of directory paths regexp patterns
32
+ List of directory paths RegExp patterns
33
33
</xs : documentation >
34
34
</xs : annotation >
35
35
<xs : sequence >
You can’t perform that action at this time.
0 commit comments