IncrementedCopy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 4 1
A handle() 0 4 1
1
<?php
2
3
namespace Druc\Flysystem\IncrementalNaming;
4
5
use League\Flysystem\FileExistsException;
6
use League\Flysystem\Plugin\AbstractPlugin;
7
8
class IncrementedCopy extends AbstractPlugin
9
{
10
    use IncrementsPath;
11
12
    /**
13
     * @inheritdoc
14
     */
15 3
    public function getMethod()
16
    {
17 3
        return 'incrementedCopy';
18
    }
19
20
    /**
21
     * @param $path
22
     * @param $newpath
23
     * @return bool
24
     * @throws FileExistsException
25
     * @throws \League\Flysystem\FileNotFoundException
26
     */
27 9
    public function handle($path, $newpath)
28
    {
29 9
        return $this->filesystem->copy($path, $this->getIncrementedPath($newpath));
30
    }
31
}
32