@@ -60,24 +60,25 @@ public function __construct(
60
60
*
61
61
* @param Gallery $subject
62
62
* @param callable $proceed
63
- * @return string
63
+ * @return string|null
64
64
* @throws FileSystemException
65
65
* @throws \Magento\Framework\Exception\RuntimeException
66
66
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
67
67
*/
68
68
public function aroundGetImageWidth (Gallery $ subject , callable $ proceed ): string
69
69
{
70
- return $ this ->copyFileToTmp ($ subject ,$ proceed );
70
+ return $ this ->copyFileToTmp ($ subject , $ proceed );
71
71
}
72
72
73
73
/**
74
74
* Move files from storage to tmp folder
75
75
*
76
76
* @param Gallery $subject
77
77
* @param callable $proceed
78
- * @return string
78
+ * @return string|null
79
79
* @throws FileSystemException
80
80
* @throws \Magento\Framework\Exception\RuntimeException
81
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
81
82
*/
82
83
private function copyFileToTmp (Gallery $ subject , callable $ proceed ): string
83
84
{
@@ -91,11 +92,10 @@ private function copyFileToTmp(Gallery $subject, callable $proceed): string
91
92
$ this ->tmpDirectoryWrite ->create ();
92
93
$ tmpPath = $ this ->storeTmpName ($ filePath );
93
94
$ content = $ this ->remoteDirectoryWrite ->getDriver ()->fileGetContents ($ filePath );
94
- $ filePath = $ this ->tmpDirectoryWrite ->getDriver ()->filePutContents ($ tmpPath , $ content )
95
+ return $ this ->tmpDirectoryWrite ->getDriver ()->filePutContents ($ tmpPath , $ content )
95
96
? $ tmpPath
96
97
: $ filePath ;
97
98
}
98
- return $ filePath ;
99
99
}
100
100
}
101
101
0 commit comments