OperationAnalyser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A isPatcherUninstallOperation() 0 7 2
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