CommandHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 17
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the skeleton package.
7
 *
8
 * (c) Gennady Knyazkin <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Gennadyx\Skeleton;
15
16
use Composer\Script\Event;
17
18
/**
19
 * Handler for 'post-create-project-cmd' script
20
 *
21
 * @author Gennady Knyazkin <[email protected]>
22
 */
23
class CommandHandler
24
{
25
    /**
26
     * Handle command
27
     *
28
     * @param Event $event
29
     */
30 2
    public static function handle(Event $event)
31
    {
32
        try {
33 2
            PackageBuilder::install($event);
34 2
            $event->getIO()->write('Build successful!');
35
        } catch (\Exception $e) {
36
            $event->getIO()->writeError($e->getMessage());
37
        }
38 2
    }
39
}
40