DummyCompressor   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 32
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A compress() 0 8 3
A uncompress() 0 8 2
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Component\Compressor;
11
12
class DummyCompressor implements CompressorInterface
13
{
14
    /**
15
     * @param string $source
16
     * @param string $target
17
     *
18
     * @return bool
19
     */
20 2
    public function compress($source, $target = '')
21
    {
22 2
        if ($target && $target != $source) {
23 1
            return copy($source, $target);
24
        }
25
26 1
        return true;
27
    }
28
29
    /**
30
     * @param string $source
31
     * @param string $target
32
     *
33
     * @return bool
34
     */
35 2
    public function uncompress($source, $target)
36
    {
37 2
        if ($target != $source) {
38 1
            return copy($source, $target);
39
        }
40
41 1
        return true;
42
    }
43
}
44