1
0
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:
Stefano Sala 2014-04-14 08:28:59 +02:00
parent b52ba738ba
commit 9c1c9b885e

View File

@ -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;
}