Completed
Push — develop ( fbdd82...317691 )
by Mike
09:29
created

FlySystemArtefacts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A persist() 0 4 1
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2016 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace phpDocumentor\Infrastructure\Renderer;
14
15
use League\Flysystem\Filesystem;
16
use League\Flysystem\MountManager;
17
use phpDocumentor\DomainModel\Renderer\Artefact;
18
use phpDocumentor\DomainModel\Renderer\Artefacts;
19
20
final class FlySystemArtefacts implements Artefacts
21
{
22
    /** @var Filesystem|MountManager */
23
    private $filesystem;
24
25
    /**
26
     * @param Filesystem|MountManager $filesystem
27
     */
28
    public function __construct($filesystem)
29
    {
30
        $this->filesystem = $filesystem;
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function persist(Artefact $artefact)
37
    {
38
        $this->filesystem->put($artefact->location(), $artefact->content());
39
    }
40
}
41