SchemaHandler::logsSchemaUpdate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Norsys\LogsBundle\Composer;
4
5
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler;
6
use Composer\Script\Event;
7
8
/**
9
 * Class SchemaHandler
10
 */
11
class SchemaHandler extends ScriptHandler
12
{
13
    /**
14
     * Logs schema create
15
     *
16
     * @param Event $event
17
     */
18
    public static function logsSchemaCreate(Event $event)
19
    {
20
        $options = static::getOptions($event);
21
        $consoleDir = static::getConsoleDir($event, 'create logs schema');
22
23
        if (null === $consoleDir) {
24
            return;
25
        }
26
27
        static::executeCommand($event, $consoleDir, 'norsys:logs:schema-create --force', $options['process-timeout']);
28
    }
29
30
    /**
31
     * Logs schema create
32
     *
33
     * @param Event $event
34
     */
35
    public static function logsSchemaUpdate(Event $event)
36
    {
37
        $options = static::getOptions($event);
38
        $consoleDir = static::getConsoleDir($event, 'update logs schema');
39
40
        if (null === $consoleDir) {
41
            return;
42
        }
43
44
        static::executeCommand($event, $consoleDir, 'norsys:logs:schema-update --force', $options['process-timeout']);
45
    }
46
}
47