Completed
Push — master ( b2e536...a4e6dd )
by Arne
02:05
created

WriteSynchronizationOperation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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