Passed
Push — master ( b99b34...fbcc23 )
by Harm
01:36
created

ScriptHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 18
ccs 0
cts 9
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A linkAssets() 0 12 1
1
<?php
2
3
namespace HarmBandstra\SwaggerUiBundle\Composer;
4
5
use Composer\Script\Event;
6
use Symfony\Component\Filesystem\Filesystem;
7
8
class ScriptHandler
9
{
10
    /**
11
     * @param Event $event
12
     */
13
    public static function linkAssets(Event $event)
14
    {
15
        $filesystem = new Filesystem();
16
        $vendorDir = __DIR__.'/../../../..';
17
18
        $source = sprintf('%s/swagger-api/swagger-ui/dist', $vendorDir);
19
        $target = sprintf('%s/harmbandstra/swagger-ui-bundle/src/Resources/public', $vendorDir);
20
21
        $filesystem->mirror($source, $target, null, ['override' => true]);
22
23
        $event->getIO()->write('Linked SwaggerUI assets.');
24
    }
25
}
26