public static deleteIfExists ( $path ) : boolean | ||
$path | ||
return | boolean |
public static function deleteIfExists($path)
{
if (self::exists($path)) {
return self::delete($path);
}
return false;
}
/** * @test */ public function shouldReturnFalseIfNotExistsAnTryToDelete() { //when $deleteIfExists = Files::deleteIfExists('/broken/path/file'); //then $this->assertFalse($deleteIfExists); }