SeedPublisher::getDestinationPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Consigliere\Components\Publishing;
4
5
use Consigliere\Components\Migrations\Seeder;
6
7 View Code Duplication
class SeedPublisher extends AssetPublisher
0 ignored issues
show
Duplication introduced by
This class 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...
8
{
9
    /**
10
     * @var Seeder
11
     */
12
    private $seeder;
13
14
    /**
15
     * MigrationPublisher constructor.
16
     *
17
     * @param Seeder $seeder
18
     */
19
    public function __construct(Seeder $seeder)
20
    {
21
        $this->seeder = $seeder;
22
        parent::__construct($seeder->getComponent());
23
    }
24
25
    /**
26
     * Get destination path.
27
     *
28
     * @return string
29
     */
30
    public function getDestinationPath()
31
    {
32
        return $this->repository->config('paths.seed');
33
    }
34
35
    /**
36
     * Get source path.
37
     *
38
     * @return string
39
     */
40
    public function getSourcePath()
41
    {
42
        return $this->seeder->getPath();
43
    }
44
}
45