4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
- // @codingStandardsIgnoreFile
8
-
9
7
/**
10
- * Helper class that simplifies files stream reading and writing
11
- */
8
+ * Helper class that simplifies files stream reading and writing
9
+ */
12
10
namespace Magento \Framework \Archive \Helper ;
13
11
14
12
use Magento \Framework \Exception \LocalizedException ;
15
- use Magento \Framework \Filesystem \DriverInterface ;
16
13
17
14
class File
18
15
{
@@ -98,7 +95,10 @@ public function open($mode = 'w+', $chmod = null)
98
95
if ($ this ->_isInWriteMode ) {
99
96
if (!is_writable ($ this ->_fileLocation )) {
100
97
throw new LocalizedException (
101
- new \Magento \Framework \Phrase ('Permission denied to write to %1 ' , [$ this ->_fileLocation ])
98
+ new \Magento \Framework \Phrase (
99
+ 'Permission denied to write to %1 ' ,
100
+ [$ this ->_fileLocation ]
101
+ )
102
102
);
103
103
}
104
104
@@ -199,7 +199,9 @@ protected function _open($mode)
199
199
$ this ->_fileHandler = @fopen ($ this ->_filePath , $ mode );
200
200
201
201
if (false === $ this ->_fileHandler ) {
202
- throw new LocalizedException (new \Magento \Framework \Phrase ('Failed to open file %1 ' , [$ this ->_filePath ]));
202
+ throw new LocalizedException (
203
+ new \Magento \Framework \Phrase ('Failed to open file %1 ' , [$ this ->_filePath ])
204
+ );
203
205
}
204
206
}
205
207
@@ -215,7 +217,9 @@ protected function _write($data)
215
217
$ result = @fwrite ($ this ->_fileHandler , $ data );
216
218
217
219
if (false === $ result ) {
218
- throw new LocalizedException (new \Magento \Framework \Phrase ('Failed to write data to %1 ' , [$ this ->_filePath ]));
220
+ throw new LocalizedException (
221
+ new \Magento \Framework \Phrase ('Failed to write data to %1 ' , [$ this ->_filePath ])
222
+ );
219
223
}
220
224
}
221
225
@@ -293,4 +297,4 @@ protected function _checkFileOpened()
293
297
throw new LocalizedException (new \Magento \Framework \Phrase ('File not opened ' ));
294
298
}
295
299
}
296
- }
300
+ }
0 commit comments