Issues (9)

src/ServiceProvider/CommandServiceProvider.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
namespace DanielPieper\MergeReminder\ServiceProvider;
4
5
use DanielPieper\MergeReminder\Command\ApproverCommand;
6
use DanielPieper\MergeReminder\Command\OverviewCommand;
7
use DanielPieper\MergeReminder\Command\ProjectCommand;
8
use DanielPieper\MergeReminder\Filter\MergeRequestApprovalFilter;
9
use DanielPieper\MergeReminder\Service\MergeRequestApprovalService;
10
use DanielPieper\MergeReminder\Service\MergeRequestService;
11
use DanielPieper\MergeReminder\Service\ProjectService;
12
use DanielPieper\MergeReminder\Service\UserService;
13
use League\Container\Container;
14
use League\Container\ServiceProvider\AbstractServiceProvider;
15
16
class CommandServiceProvider extends AbstractServiceProvider
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected $provides = [
22
        OverviewCommand::class,
23
        ProjectCommand::class,
24
        ApproverCommand::class,
25
    ];
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function register()
31
    {
32
        /** @var Container $container */
33
        $container = $this->getContainer();
34
35
        $container->share(OverviewCommand::class)
0 ignored issues
show
The method share() does not exist on League\Container\Container. ( Ignorable by Annotation )

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

35
        $container->/** @scrutinizer ignore-call */ 
36
                    share(OverviewCommand::class)

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
36
            ->addArguments([
37
                ProjectService::class,
38
                MergeRequestService::class,
39
                MergeRequestApprovalService::class,
40
            ]);
41
42
        $container->share(ProjectCommand::class)
43
            ->addArguments([
44
                ProjectService::class,
45
                MergeRequestService::class,
46
                MergeRequestApprovalService::class,
47
                MergeRequestApprovalFilter::class,
48
            ]);
49
50
        $container->share(ApproverCommand::class)
51
            ->addArguments([
52
                ProjectService::class,
53
                UserService::class,
54
                MergeRequestService::class,
55
                MergeRequestApprovalService::class,
56
                MergeRequestApprovalFilter::class,
57
            ]);
58
    }
59
}
60