Passed
Push — master ( 27afec...e8b4e9 )
by Klaas
01:42 queued 14s
created

LiveTemplatesPatcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 19
ccs 0
cts 6
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A patch() 0 8 2
1
<?php declare(strict_types=1);
2
/**
3
 * Copyright MediaCT. All rights reserved.
4
 * https://www.mediact.nl
5
 */
6
7
namespace Mediact\CodingStandard\PhpStorm\Patcher;
8
9
use Mediact\CodingStandard\PhpStorm\EnvironmentInterface;
10
use Mediact\CodingStandard\PhpStorm\FilesystemInterface;
11
12
class LiveTemplatesPatcher implements ConfigPatcherInterface
13
{
14
    use CopyFilesTrait;
15
16
    /**
17
     * Patch the config.
18
     *
19
     * @param EnvironmentInterface $environment
20
     *
21
     * @return void
22
     */
23
    public function patch(
24
        EnvironmentInterface $environment
25
    ): void {
26
        if (! empty($environment->getIdeDefaultConfigFilesystem()->getRoot())) {
27
            $this->copyDirectory(
28
                $environment->getDefaultsFilesystem(),
29
                $environment->getIdeDefaultConfigFilesystem(),
30
                'templates'
31
            );
32
        }
33
    }
34
}
35