Completed
Push — feature/host-swagger-through-p... ( 67ca0b )
by Lucas
07:54
created

ScriptHandler::copySwagger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 8
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * swagger composer scripthandler
4
 */
5
6
namespace Graviton\SwaggerBundle\Composer;
7
8
use Graviton\CoreBundle\Composer\ScriptHandlerBase;
9
use Composer\Script\CommandEvent;
10
11
/**
12
 * ScriptHandler for Composer, wrapping our symfony console commands..
13
 *
14
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
15
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
16
 * @link     http://swisscom.ch
17
 */
18
class ScriptHandler extends ScriptHandlerBase
0 ignored issues
show
Coding Style introduced by
ScriptHandler does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
19
{
20
    /**
21
     * Generates swagger.json
22
     *
23
     * @param CommandEvent $event Event
24
     *
25
     * @return void
26
     */
27 View Code Duplication
    public static function generateSwaggerJson(CommandEvent $event)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
    {
29
        $options = self::getOptions($event);
30
        $consolePath = $options['symfony-app-dir'];
31
        $cmd = escapeshellarg('graviton:swagger:generate');
32
33
        self::executeCommand($event, $consolePath, $cmd);
34
    }
35
}
36