ScriptHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkHealth() 0 9 2
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