WriteSynchronizationOperation   A
last analyzed

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\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