Completed
Branch full-rewrite (4754d3)
by Thibaud
03:13
created

StreamWriter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
wmc 1
lcom 0
cbo 3
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A write() 0 6 1
1
<?php
2
3
namespace Alchemy\Zippy\Package\Writer;
4
5
use Alchemy\Zippy\Package\PackagedResource;
6
use Alchemy\Zippy\Resource\ResourceUri;
7
8
class StreamWriter
9
{
10
11
    public function write(PackagedResource $source, ResourceUri $destination)
12
    {
13
        $target = $destination->getResource() . '/' . $source->getRelativeUri()->getResource();
14
15
        file_put_contents($target, $source->getReader()->getContents());
16
    }
17
}
18