RecreateDatabaseListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 25
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A onPreSyncDb() 0 4 1
1
<?php
2
3
namespace Velikonja\LabbyBundle\Event\Listener;
4
5
use Velikonja\LabbyBundle\Database\CreatorDB;
6
use Velikonja\LabbyBundle\Event\SyncEvent;
7
8
class RecreateDatabaseListener
9
{
10
    /**
11
     * @var CreatorDB
12
     */
13
    private $creator;
14
15
    /**
16
     * @param CreatorDB $creator
17
     */
18 3
    public function __construct(CreatorDB $creator)
19
    {
20 3
        $this->creator = $creator;
21 3
    }
22
23
    /**
24
     * Changes password for all users.
25
     *
26
     * @param SyncEvent $event
27
     */
28 3
    public function onPreSyncDb(SyncEvent $event)
29
    {
30 3
        $this->creator->create($event->getOutput());
31 3
    }
32
}
33