RecreateDatabaseListener::onPreSyncDb()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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