Completed
Pull Request — experimental/3.1 (#2566)
by chihiro
205:03 queued 181:20
created

ForwardOnlyServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 14
rs 10
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A subscribe() 0 4 1
1
<?php
2
3
namespace Eccube\ServiceProvider;
4
5
6
use Eccube\EventListener\ForwardOnlyListener;
7
use Pimple\Container;
8
use Pimple\ServiceProviderInterface;
9
use Silex\Api\EventListenerProviderInterface;
10
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
11
12
class ForwardOnlyServiceProvider implements EventListenerProviderInterface, ServiceProviderInterface
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
13
{
14
    public function register(Container $app)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
15
    {
16
        $app['eccube.listener.forward_only'] = function (Container $app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

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

Loading history...
17
            return new ForwardOnlyListener();
18
        };
19
    }
20
21
    public function subscribe(Container $app, EventDispatcherInterface $dispatcher)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
22
    {
23
        $dispatcher->addSubscriber($app['eccube.listener.forward_only']);
24
    }
25
}