Completed
Pull Request — master (#666)
by reallyli
02:28
created

MigrationPublisher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 37
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 2
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDestinationPath() 0 4 1
A getSourcePath() 0 4 1
1
<?php
2
3
namespace Nwidart\Modules\Publishing;
4
5
use Nwidart\Modules\Migrations\Migrator;
6
7
class MigrationPublisher extends AssetPublisher
8
{
9
    /**
10
     * @var Migrator
11
     */
12
    private $migrator;
13
14
    /**
15
     * MigrationPublisher constructor.
16
     * @param Migrator $migrator
17
     */
18
    public function __construct(Migrator $migrator)
19
    {
20
        $this->migrator = $migrator;
21
        parent::__construct($migrator->getModule());
22
    }
23
24
    /**
25
     * Get destination path.
26
     *
27
     * @return string
28
     */
29
    public function getDestinationPath()
30
    {
31
        return $this->repository->config('paths.migration');
32
    }
33
34
    /**
35
     * Get source path.
36
     *
37
     * @return string
38
     */
39
    public function getSourcePath()
40
    {
41
        return $this->migrator->getPath();
42
    }
43
}
44