Completed
Push — master ( 3cb930...50d371 )
by Anton
02:32
created

Installer::getInstallPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * Bluz composer installer
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link https://github.com/bluzphp/composer-plugin
7
 */
8
9
/**
10
 * @namespace
11
 */
12
namespace Bluz\Composer\Installers;
13
14
use Composer\Installer\LibraryInstaller;
15
use Composer\IO\IOInterface;
16
use Composer\Package\PackageInterface;
17
18
class Installer extends LibraryInstaller
19
{
20
    protected $vendorPath;
21
22
    /**
23
     * Get path to the installation package
24
     *
25
     * {@inheritDoc}
26
     */
27
    public function getInstallPath(PackageInterface $package): string
28
    {
29
        $this->vendorPath = parent::getInstallPath($package);
30
        return $this->vendorPath;
31
    }
32
33
    /**
34
     * Check type of the plugin
35
     *
36
     * {@inheritDoc}
37
     */
38
    public function supports($packageType)
39
    {
40
        return $packageType === 'bluz-module';
41
    }
42
43
    /**
44
     * Get inputOutput instance
45
     */
46
    public function getIo(): IOInterface
47
    {
48
        return $this->io;
49
    }
50
51
    /**
52
     * Get path to current vendor
53
     */
54
    public function getVendorPath()
55
    {
56
        return $this->vendorPath;
57
    }
58
}
59