File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
lib/internal/Magento/Framework/Filesystem Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -193,13 +193,13 @@ public function delete($path = null)
193
193
} catch (FileSystemException $ e ) {
194
194
$ exceptionMessages [] = $ e ->getMessage ();
195
195
}
196
- }
197
- if (! empty ( $ exceptionMessages )) {
198
- throw new FileSystemException (
199
- new \ Magento \ Framework \ Phrase (
200
- \implode ( ' ' , $ exceptionMessages )
201
- )
202
- );
196
+ if (! empty ( $ exceptionMessages )) {
197
+ throw new FileSystemException (
198
+ new \ Magento \ Framework \ Phrase (
199
+ \implode ( ' ' , $ exceptionMessages )
200
+ )
201
+ );
202
+ }
203
203
}
204
204
return true ;
205
205
}
Original file line number Diff line number Diff line change @@ -405,14 +405,14 @@ public function deleteDirectory($path)
405
405
$ iterator = new \FilesystemIterator ($ path , $ flags );
406
406
/** @var \FilesystemIterator $entity */
407
407
foreach ($ iterator as $ entity ) {
408
- if ( $ entity -> isDir ()) {
409
- try {
408
+ try {
409
+ if ( $ entity -> isDir ()) {
410
410
$ this ->deleteDirectory ($ entity ->getPathname ());
411
- } catch ( FileSystemException $ exception ) {
412
- $ exceptionMessages [] = $ exception -> getMessage ( );
411
+ } else {
412
+ $ this -> deleteFile ( $ entity -> getPathname () );
413
413
}
414
- } else {
415
- $ this -> deleteFile ( $ entity -> getPathname () );
414
+ } catch ( FileSystemException $ exception ) {
415
+ $ exceptionMessages [] = $ exception -> getMessage ( );
416
416
}
417
417
}
418
418
if (!empty ($ exceptionMessages )) {
You can’t perform that action at this time.
0 commit comments