Rename   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 35
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setFilePath() 0 4 1
A getCommand() 0 3 1
A getExtraData() 0 3 1
A getData() 0 3 1
A getFilePosition() 0 3 1
A setNewPath() 0 4 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