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

WriteSynchronizationOperation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A execute() 0 6 1
A __toString() 0 4 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