CommandHandler::handle()   A
last analyzed

Complexity

Conditions 2
Paths 3

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.1481

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 6
cp 0.6667
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 6
nc 3
nop 1
crap 2.1481
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