OperationAnalyser::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright © Vaimo Group. All rights reserved.
4
 * See LICENSE_VAIMO.txt for license details.
5
 */
6
namespace Vaimo\ComposerPatches\Package;
7
8
use Composer\DependencyResolver\Operation\OperationInterface;
9
10
class OperationAnalyser
11
{
12
    /**
13
     * @var \Vaimo\ComposerPatches\Package\ConfigAnalyser
14
     */
15
    private $configAnalyser;
16
17
    public function __construct()
18
    {
19
        $this->configAnalyser = new \Vaimo\ComposerPatches\Package\ConfigAnalyser();
20
    }
21
22
    public function isPatcherUninstallOperation(OperationInterface $operation)
23
    {
24
        if (!$operation instanceof \Composer\DependencyResolver\Operation\UninstallOperation) {
25
            return false;
26
        }
27
28
        return $this->configAnalyser->ownsNamespace($operation->getPackage(), __NAMESPACE__);
29
    }
30
}
31