mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-25 17:59:47 +01:00
File provider - Check for return value of copy instead of a second call
This commit is contained in:
parent
b52ba738ba
commit
9c1c9b885e
@ -587,9 +587,7 @@ class File extends \Faker\Provider\Base
|
||||
$destinationFile = Uuid::uuid() . '.' . pathinfo($sourceFullPath, PATHINFO_EXTENSION);
|
||||
$destinationFullPath = $targetDirectory . DIRECTORY_SEPARATOR . $destinationFile;
|
||||
|
||||
copy($sourceFullPath, $destinationFullPath);
|
||||
|
||||
if (!file_exists($destinationFullPath)) {
|
||||
if (false === copy($sourceFullPath, $destinationFullPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user