WriteSynchronizationOperation::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Storeman\Operation;
4
5
use Storeman\FileReader;
6
use Storeman\Synchronization;
7
use Storeman\VaultLayout\VaultLayoutInterface;
8
9
class WriteSynchronizationOperation implements OperationInterface
10
{
11
    /**
12
     * @var Synchronization
13
     */
14
    protected $synchronization;
15
16
    public function __construct(Synchronization $synchronization)
17
    {
18
        $this->synchronization = $synchronization;
19
    }
20
21
    public function execute(string $localBasePath, FileReader $fileReader, VaultLayoutInterface $vaultLayout): bool
22
    {
23
        $vaultLayout->writeSynchronization($this->synchronization, $fileReader);
24
25
        return true;
26
    }
27
28
    /**
29
     * @codeCoverageIgnore
30
     */
31
    public function __toString(): string
32
    {
33
        return "Write synchronization with revision #{$this->synchronization->getRevision()}";
34
    }
35
}
36