13
13
use Magento \Csp \Model \SubresourceIntegrityFactory ;
14
14
use Magento \Framework \App \Area ;
15
15
use Magento \Framework \App \Filesystem \DirectoryList ;
16
+ use Magento \Framework \Exception \FileSystemException ;
16
17
use Magento \Framework \Filesystem ;
17
18
use Magento \Framework \View \Asset \LocalInterface ;
18
19
use Magento \Framework \View \Asset \MergeStrategy \FileExists ;
@@ -47,9 +48,9 @@ class GenerateMergedAssetIntegrity
47
48
*/
48
49
public function __construct (
49
50
SubresourceIntegrityRepositoryPool $ sourceIntegrityRepositoryPool ,
50
- HashGenerator $ hashGenerator ,
51
- SubresourceIntegrityFactory $ integrityFactory ,
52
- Filesystem $ filesystem
51
+ HashGenerator $ hashGenerator ,
52
+ SubresourceIntegrityFactory $ integrityFactory ,
53
+ Filesystem $ filesystem
53
54
) {
54
55
$ this ->sourceIntegrityRepository = $ sourceIntegrityRepositoryPool ->get (Area::AREA_FRONTEND );
55
56
$ this ->hashGenerator = $ hashGenerator ;
@@ -58,12 +59,15 @@ public function __construct(
58
59
}
59
60
60
61
/**
62
+ * Generate SRI hash for merged JS files.
63
+ *
61
64
* @param FileExists $subject
62
65
* @param string|null $result
63
66
* @param array $assetsToMerge
64
67
* @param LocalInterface $resultAsset
65
68
* @return string|null
66
- * @throws \Magento\Framework\Exception\FileSystemException
69
+ * @throws FileSystemException
70
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
67
71
*/
68
72
public function afterMerge (FileExists $ subject , ?string $ result , array $ assetsToMerge , LocalInterface $ resultAsset )
69
73
{
0 commit comments