Skip to content

Commit d9440fa

Browse files
Fix static code issues
1 parent 482fbf8 commit d9440fa

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/Backup/Cleaner/Stepwise/Keeper/OnePerGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class OnePerGroup implements Keeper
2727
/**
2828
* List of groups containing the files.
2929
*
30-
* @var \phpbu\App\Backup\File\Local[][]
30+
* @var \phpbu\App\Backup\File[][]
3131
*/
3232
private $groups = [];
3333

src/Backup/Path.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function getPathThatIsNotChanging(): string
208208
}
209209

210210
/**
211-
* Return path when casted to string.
211+
* Return path when cast to string.
212212
*
213213
* @return string
214214
*/

src/Backup/Sync/Xtp.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace phpbu\App\Backup\Sync;
33

4+
use phpbu\App\Backup\Path;
45
use phpseclib;
56
use phpbu\App\Result;
67
use phpbu\App\Backup\Target;
@@ -45,7 +46,7 @@ abstract class Xtp implements Simulator
4546
/**
4647
* Remote path where to put the backup
4748
*
48-
* @var string
49+
* @var Path
4950
*/
5051
protected $remotePath;
5152

@@ -83,7 +84,7 @@ public function setup(array $config)
8384
$this->host = $config['host'];
8485
$this->user = $config['user'];
8586
$this->password = Util\Arr::getValue($config, 'password', '');
86-
$this->remotePath = Util\Path::withoutTrailingSlash(Util\Path::replaceDatePlaceholders($path));
87+
$this->remotePath = new Path(Util\Path::withoutTrailingSlash(Util\Path::replaceDatePlaceholders($path)));
8788
}
8889

8990
/**
@@ -99,7 +100,7 @@ public function simulate(Target $target, Result $result)
99100
. ' host: ' . $this->host . PHP_EOL
100101
. ' user: ' . $this->user . PHP_EOL
101102
. ' password: ********' . PHP_EOL
102-
. ' path: ' . $this->remotePath . PHP_EOL
103+
. ' path: ' . $this->remotePath->getPath() . PHP_EOL
103104
);
104105

105106
$this->simulateRemoteCleanup($target, $result);

src/Backup/Sync/YandexDisk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function createFolders(): void
120120
{
121121
$folderPath = '';
122122
$folderPaths = explode('/', $this->path->getPath());
123-
if (!empty($folderPaths)) {
123+
if (count($folderPaths)) {
124124
foreach ($folderPaths as $folderPathPart) {
125125
if (!empty($folderPathPart)) {
126126
$folderPath .= "/$folderPathPart";

0 commit comments

Comments
 (0)