DummyCompressor::uncompress()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 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