Passed
Push — master ( 1da312...9d0d84 )
by Filipe
12:48 queued 15s
created

ModuleEventHandling::onDisable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
/**
4
 * This file is part of orm
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\Orm\OrmModule;
13
14
use Slick\Orm\OrmModule\EventHandlers\MigrationsHandler;
15
use Slick\Orm\OrmModule\EventHandlers\OrmHandler;
16
17
/**
18
 * ModuleEventHandling
19
 *
20
 * @package Slick\Orm\OrmModule
21
 */
22
trait ModuleEventHandling
23
{
24
25
    /**
26
     * @inheritDoc
27
     */
28
    public function onEnable(array $context = []): void
29
    {
30
        $migrationsHandler = new MigrationsHandler($this->composerParser);
31
        $migrationsHandler->onEnable($context);
32
33
        $ormHandler = new OrmHandler();
34
        $ormHandler->onEnable($context);
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function onDisable(array $context = []): void
41
    {
42
        $migrationsHandler = new MigrationsHandler($this->composerParser);
43
        $migrationsHandler->onDisable($context);
44
45
        $ormHandler = new OrmHandler();
46
        $ormHandler->onDisable($context);
47
    }
48
}
49