ScriptHandler::checkHealth()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 7
cp 0
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Liip\MonitorBundle\Composer;
4
5
use Composer\Script\Event;
6
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler as BaseHandler;
7
8
/**
9
 * Composer ScriptHandler can be used to run postInstall/postUpdate health checks
10
 * when running composer.phar update/install.
11
 */
12
class ScriptHandler extends BaseHandler
13
{
14
    public static function checkHealth(Event $event)
15
    {
16
        $options = self::getOptions($event);
17
18
        // use Symfony 3.0 dir structure if available
19
        $consoleDir = isset($options['symfony-bin-dir']) ? $options['symfony-bin-dir'] : $options['symfony-app-dir'];
20
        $event->getIO()->write('<info>Performing system health checks...</info>');
21
        static::executeCommand($event, $consoleDir, 'monitor:health');
22
    }
23
}
24