Rename::getCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
namespace kalanis\RemoteRequest\Protocols\Fsp\Query;
4
5
6
use kalanis\RemoteRequest\Protocols\Fsp;
7
8
9
/**
10
 * Class Rename
11
 * @package kalanis\RemoteRequest\Protocols\Fsp\Query
12
 * Rename file on remote
13
 */
14
class Rename extends AQuery
15
{
16
    protected string $filePath = '';
17
    protected string $newPath = '';
18
19 1
    protected function getCommand(): int
20
    {
21 1
        return Fsp::CC_RENAME;
22
    }
23
24 1
    public function setFilePath(string $filePath): self
25
    {
26 1
        $this->filePath = $filePath;
27 1
        return $this;
28
    }
29
30 1
    public function setNewPath(string $newPath): self
31
    {
32 1
        $this->newPath = $newPath;
33 1
        return $this;
34
    }
35
36 1
    protected function getFilePosition(): int
37
    {
38 1
        return strlen($this->getExtraData());
39
    }
40
41 1
    protected function getData(): string
42
    {
43 1
        return $this->filePath . chr(0);
44
    }
45
46 1
    protected function getExtraData(): string
47
    {
48 1
        return $this->newPath . chr(0);
49
    }
50
}
51