LiveTemplatesPatcher   A
last analyzed

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