ConvergeCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 13
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 11
nc 1
nop 5
crap 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Baleen\Migrations\Service\DomainBus\Migrate\Converge;
21
22
use Baleen\Migrations\Migration\OptionsInterface;
23
use Baleen\Migrations\Service\DomainBus\DomainCommandInterface;
24
use Baleen\Migrations\Service\DomainBus\HasCollectionTrait;
25
use Baleen\Migrations\Service\DomainBus\HasOptionsTrait;
26
use Baleen\Migrations\Service\DomainBus\HasVersionRepositoryTrait;
27
use Baleen\Migrations\Service\DomainBus\Migrate\Collection;
28
use Baleen\Migrations\Service\DomainBus\Migrate\HasTargetTrait;
29
use Baleen\Migrations\Common\Collection\CollectionInterface;
30
use Baleen\Migrations\Delta\Repository\VersionRepositoryInterface;
31
use Baleen\Migrations\Delta\DeltaInterface;
32
use League\Tactician\CommandBus;
33
34
/**
35
 * Class ConvergeCommand
36
 * @author Gabriel Somoza <[email protected]>
37
 */
38
final class ConvergeCommand implements DomainCommandInterface
39
{
40
    use HasCollectionTrait;
41
    use HasTargetTrait;
42
    use HasOptionsTrait;
43
    use HasVersionRepositoryTrait;
44
45
    /** @var CommandBus */
46
    private $domainBus;
47
48
    /**
49
     * CollectionCommand constructor.
50
     *
51
     * @param \Baleen\Migrations\Common\Collection\CollectionInterface $collection
52
     * @param DeltaInterface $target
53
     * @param OptionsInterface $options
54
     * @param CommandBus $domainBus
55
     * @param VersionRepositoryInterface $versionRepository
56
     */
57 8 View Code Duplication
    public function __construct(
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...
58
        CollectionInterface $collection,
59
        DeltaInterface $target,
60
        OptionsInterface $options,
61
        CommandBus $domainBus,
62
        VersionRepositoryInterface $versionRepository
63
    ) {
64 8
        $this->domainBus = $domainBus;
65 8
        $this->setCollection($collection);
66 8
        $this->setTarget($target);
67 8
        $this->setOptions($options);
68 8
        $this->setVersionRepository($versionRepository);
69 8
    }
70
71
    /**
72
     * getDomainBus
73
     *
74
     * @return CommandBus
75
     */
76 8
    final public function getDomainBus()
0 ignored issues
show
Coding Style introduced by
Unnecessary FINAL modifier in FINAL class
Loading history...
77
    {
78 8
        return $this->domainBus;
79
    }
80
}
81