Completed
Push — master ( 8a9462...6693ad )
by Beñat
02:57
created

RemoveAction::removeAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\FileBundle\Controller;
14
15
use BenGorFile\File\Application\Command\Remove\RemoveFileCommand;
16
use BenGorFile\File\Infrastructure\CommandBus\FileCommandBus;
17
18
/**
19
 * BenGor file's remove action trait.
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
trait RemoveAction
24
{
25
    /**
26
     * Overwrite action.
27
     *
28
     * @param string         $anId        The file id
29
     * @param FileCommandBus $aCommandBus The command bus
30
     */
31
    public function removeAction($anId, FileCommandBus $aCommandBus)
32
    {
33
        $aCommandBus->handle(
34
            new RemoveFileCommand($anId)
35
        );
36
    }
37
}
38