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

TransactionServiceProvider::subscribe()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
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
}