14
14
use Magento \Framework \App \Filesystem \DirectoryList ;
15
15
use Magento \Framework \Exception \FileSystemException ;
16
16
use Magento \Framework \Filesystem ;
17
+ use Magento \Framework \Filesystem \Io \File ;
17
18
18
19
class GenerateBundleAssetIntegrity
19
20
{
@@ -37,22 +38,30 @@ class GenerateBundleAssetIntegrity
37
38
*/
38
39
private Filesystem $ filesystem ;
39
40
41
+ /**
42
+ * @var File
43
+ */
44
+ private File $ fileIo ;
45
+
40
46
/**
41
47
* @param HashGenerator $hashGenerator
42
48
* @param SubresourceIntegrityFactory $integrityFactory
43
49
* @param SubresourceIntegrityCollector $integrityCollector
44
50
* @param Filesystem $filesystem
51
+ * @param File $fileIo
45
52
*/
46
53
public function __construct (
47
54
HashGenerator $ hashGenerator ,
48
55
SubresourceIntegrityFactory $ integrityFactory ,
49
56
SubresourceIntegrityCollector $ integrityCollector ,
50
- Filesystem $ filesystem
57
+ Filesystem $ filesystem ,
58
+ File $ fileIo ,
51
59
) {
52
60
$ this ->hashGenerator = $ hashGenerator ;
53
61
$ this ->integrityFactory = $ integrityFactory ;
54
62
$ this ->integrityCollector = $ integrityCollector ;
55
63
$ this ->filesystem = $ filesystem ;
64
+ $ this ->fileIo = $ fileIo ;
56
65
}
57
66
58
67
/**
@@ -82,7 +91,7 @@ public function afterDeploy(Bundle $subject, ?string $result, string $area, stri
82
91
$ pubStaticDir ->readFile ($ file )
83
92
),
84
93
'path ' => $ area . '/ ' . $ theme . '/ ' . $ locale .
85
- "/ " . Bundle::BUNDLE_JS_DIR . '/ ' . pathinfo ($ file )['basename ' ]
94
+ "/ " . Bundle::BUNDLE_JS_DIR . '/ ' . $ this -> fileIo -> getPathInfo ($ file )['basename ' ]
86
95
]
87
96
]
88
97
);
0 commit comments