FinalizeStep::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of `Composer as a service`.
5
 *
6
 * (c) Pascal Borreli <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ayaline\Bundle\ComposerBundle\Consumer\Step;
13
14
use Sonata\NotificationBundle\Consumer\ConsumerEvent;
15
16
/**
17
 * @author Hubert Moutot <[email protected]>
18
 */
19
class FinalizeStep extends AbstractStep
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function execute(ConsumerEvent $event, $directory)
25
    {
26
        $sha1LockFile = sha1_file($this->workingTempPath.'/'.$directory.'/composer.lock');
27
28
        $this->triggerSuccess($event, ['link' => '/assets/'.$sha1LockFile.'/vendor.zip']);
29
        $this->filesystem->remove($this->workingTempPath.'/'.$directory);
30
31
        return 0;
32
    }
33
}
34