Issues (8)

src/Composer/Plugin.php (4 issues)

Severity
1
<?php
2
/**
3
 * Copyright MediaCT. All rights reserved.
4
 * https://www.mediact.nl
5
 */
6
7
namespace Mediact\DependencyGuard\Composer;
8
9
use Composer\Composer;
10
use Composer\IO\IOInterface;
11
use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability;
12
use Composer\Plugin\Capable;
13
use Composer\Plugin\PluginInterface;
14
15
class Plugin implements PluginInterface, Capable
16
{
17
    /**
18
     * Announce the capabilities of the dependency guard plugin.
19
     *
20
     * @return string[]
21
     */
22 1
    public function getCapabilities(): array
23
    {
24
        return [
25 1
            CommandProviderCapability::class => CommandProvider::class
26
        ];
27
    }
28
29
    /**
30
     * Apply plugin modifications to Composer.
31
     *
32
     * @param Composer    $composer
33
     * @param IOInterface $io
34
     *
35
     * @return void
36
     */
37 1
    public function activate(Composer $composer, IOInterface $io): void
38
    {
39
        // There is nothing explicit that needs to happen.
40 1
    }
41
    
42
    /**
43
     * Remove any hooks from Composer
44
     *
45
     * This will be called when a plugin is deactivated before being
46
     * uninstalled, but also before it gets upgraded to a new version
47
     * so the old one can be deactivated and the new one activated.
48
     *
49
     * @param Composer    $composer
50
     * @param IOInterface $io
51
     */
52
    public function deactivate(Composer $composer, IOInterface $io): void
0 ignored issues
show
The parameter $io is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

52
    public function deactivate(Composer $composer, /** @scrutinizer ignore-unused */ IOInterface $io): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $composer is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

52
    public function deactivate(/** @scrutinizer ignore-unused */ Composer $composer, IOInterface $io): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
    {
54
        // There is nothing explicit that needs to happen.
55
    }
56
57
    /**
58
     * Prepare the plugin to be uninstalled
59
     *
60
     * This will be called after deactivate.
61
     *
62
     * @param Composer    $composer
63
     * @param IOInterface $io
64
     */
65
    public function uninstall(Composer $composer, IOInterface $io): void
0 ignored issues
show
The parameter $io is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

65
    public function uninstall(Composer $composer, /** @scrutinizer ignore-unused */ IOInterface $io): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $composer is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

65
    public function uninstall(/** @scrutinizer ignore-unused */ Composer $composer, IOInterface $io): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
66
    {
67
        // There is nothing explicit that needs to happen.
68
    }
69
}
70