1414use Magento \Framework \App \Filesystem \DirectoryList ;
1515use Magento \Framework \Exception \FileSystemException ;
1616use Magento \Framework \Filesystem ;
17+ use Magento \Framework \Filesystem \Io \File ;
1718
1819class GenerateBundleAssetIntegrity
1920{
@@ -37,22 +38,30 @@ class GenerateBundleAssetIntegrity
3738 */
3839 private Filesystem $ filesystem ;
3940
41+ /**
42+ * @var File
43+ */
44+ private File $ fileIo ;
45+
4046 /**
4147 * @param HashGenerator $hashGenerator
4248 * @param SubresourceIntegrityFactory $integrityFactory
4349 * @param SubresourceIntegrityCollector $integrityCollector
4450 * @param Filesystem $filesystem
51+ * @param File $fileIo
4552 */
4653 public function __construct (
4754 HashGenerator $ hashGenerator ,
4855 SubresourceIntegrityFactory $ integrityFactory ,
4956 SubresourceIntegrityCollector $ integrityCollector ,
50- Filesystem $ filesystem
57+ Filesystem $ filesystem ,
58+ File $ fileIo ,
5159 ) {
5260 $ this ->hashGenerator = $ hashGenerator ;
5361 $ this ->integrityFactory = $ integrityFactory ;
5462 $ this ->integrityCollector = $ integrityCollector ;
5563 $ this ->filesystem = $ filesystem ;
64+ $ this ->fileIo = $ fileIo ;
5665 }
5766
5867 /**
@@ -82,7 +91,7 @@ public function afterDeploy(Bundle $subject, ?string $result, string $area, stri
8291 $ pubStaticDir ->readFile ($ file )
8392 ),
8493 'path ' => $ area . '/ ' . $ theme . '/ ' . $ locale .
85- "/ " . Bundle::BUNDLE_JS_DIR . '/ ' . pathinfo ($ file )['basename ' ]
94+ "/ " . Bundle::BUNDLE_JS_DIR . '/ ' . $ this -> fileIo -> getPathInfo ($ file )['basename ' ]
8695 ]
8796 ]
8897 );
0 commit comments