Plugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCapabilities() 0 4 1
A activate() 0 4 1
1
<?php
2
/**
3
 * YOURLS Composer Installer
4
 */
5
6
namespace YOURLS\ComposerInstaller;
7
8
use Composer\Composer;
9
use Composer\IO\IOInterface;
10
use Composer\Plugin\PluginInterface;
11
use Composer\Plugin\Capable;
12
13
/**
14
 * YOURLS Composer Installer Plugin
15
 *
16
 * This class activates the plugin installer and registers the class that will add
17
 * custom commands
18
 *
19
 * @package   YOURLS\ComposerInstaller
20
 * @author    Ozh <[email protected]>
21
 * @link      https://github.com/yourls/composer-installer/
22
 * @license   MIT
23
 */
24
class Plugin implements PluginInterface, Capable
25
{
26
    /**
27
     * Register plugin installer with Composer
28
     *
29
     * @param Composer    $composer
30
     * @param IOInterface $io
31
     */
32 1
    public function activate(Composer $composer, IOInterface $io)
33
    {
34 1
        $installer = new PluginInstaller($io, $composer);
35 1
        $composer->getInstallationManager()->addInstaller($installer);
36 1
    }
37
38 1
    public function getCapabilities()
39
    {
40
        return array(
41 1
            'Composer\Plugin\Capability\CommandProvider' => 'YOURLS\ComposerInstaller\CommandProvider',
42
        );
43
    }
44
45
}
46