💚 Update rules for PHPMD
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2021-06-30 16:00:24 +02:00
parent aa9127262f
commit ba5910f3bd
9 changed files with 59 additions and 32 deletions

View File

@@ -2,6 +2,7 @@
namespace Shikiryu\Backup\Transport;
use Exception;
use Shikiryu\Backup\Backup\BackupAbstract;
class Folder extends TransportAbstract
@@ -25,7 +26,7 @@ class Folder extends TransportAbstract
/**
* @return bool
*
* @throws \Exception
* @throws Exception
*/
public function send()
{
@@ -35,7 +36,7 @@ class Folder extends TransportAbstract
if ($this->backup->isLocal()) {
foreach ($this->backup->getFilesToBackup() as $file => $name) {
if (copy($file, $this->folder . $name) === false) {
throw new \Exception(sprintf('Copy of %s in %s failed', $name, $this->folder));
throw new Exception(sprintf('Copy of %s in %s failed', $name, $this->folder));
}
}
foreach ($this->backup->getStreamsToBackup() as $name => $file) {
@@ -43,7 +44,7 @@ class Folder extends TransportAbstract
$name = 'backup' . $name . '.txt';
}
if (file_put_contents($this->folder . $name, $file) === false) {
throw new \Exception(sprintf('Saving of %s in %s failed', $name, $this->folder));
throw new Exception(sprintf('Saving of %s in %s failed', $name, $this->folder));
}
}
}