Skip to content

Commit

Permalink
Tweak the code to avoid fabbot false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 12, 2020
1 parent ec47520 commit ab8b27b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function mkdir($dirs, $mode = 0777)
if (!is_dir($dir)) {
// The directory was not created by a concurrent process. Let's throw an exception with a developer friendly error message if we have one
if (self::$lastError) {
throw new IOException(sprintf('Failed to create "%s": %s.', $dir, self::$lastError), 0, null, $dir);
throw new IOException(sprintf('Failed to create "%s": '.self::$lastError, $dir), 0, null, $dir);
}
throw new IOException(sprintf('Failed to create "%s".', $dir), 0, null, $dir);
}
Expand Down Expand Up @@ -171,16 +171,16 @@ public function remove($files)
if (is_link($file)) {
// See https://bugs.php.net/52176
if (!(self::box('unlink', $file) || '\\' !== \DIRECTORY_SEPARATOR || self::box('rmdir', $file)) && file_exists($file)) {
throw new IOException(sprintf('Failed to remove symlink "%s": %s.', $file, self::$lastError));
throw new IOException(sprintf('Failed to remove symlink "%s": '.self::$lastError, $file));
}
} elseif (is_dir($file)) {
$this->remove(new \FilesystemIterator($file, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS));

if (!self::box('rmdir', $file) && file_exists($file)) {
throw new IOException(sprintf('Failed to remove directory "%s": %s.', $file, self::$lastError));
throw new IOException(sprintf('Failed to remove directory "%s": '.self::$lastError, $file));
}
} elseif (!self::box('unlink', $file) && file_exists($file)) {
throw new IOException(sprintf('Failed to remove file "%s": %s.', $file, self::$lastError));
throw new IOException(sprintf('Failed to remove file "%s": '.self::$lastError, $file));
}
}
}
Expand Down

0 comments on commit ab8b27b

Please sign in to comment.