Completed
Push — experimental/3.1 ( 24445a...d4772e )
by Yangsin
271:33 queued 265:16
created

TransactionServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 1
A subscribe() 0 4 1
1
<?php
2
3
namespace Eccube\ServiceProvider;
4
5
6
use Eccube\EventListener\TransactionListener;
7
use Pimple\Container;
8
use Pimple\ServiceProviderInterface;
9
use Silex\Api\EventListenerProviderInterface;
10
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
11
12
class TransactionServiceProvider 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.transaction.enabled'] = true;
17
18
        $app['eccube.listener.transaction'] = function (Container $app) {
19
            $listener = new TransactionListener(
20
                $app['orm.em'],
21
                $app['logger'],
22
                $app['eccube.listener.transaction.enabled']
23
            );
24
25
            return $listener;
26
        };
27
    }
28
29
    public function subscribe(Container $app, EventDispatcherInterface $dispatcher)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
30
    {
31
        $dispatcher->addSubscriber($app['eccube.listener.transaction']);
32
    }
33
}