Completed
Pull Request — master (#46)
by John
03:27
created

MigrationPublisher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

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 1
    public function __construct(Migrator $migrator)
19
    {
20 1
        $this->migrator = $migrator;
21 1
        parent::__construct($migrator->getModule());
22 1
    }
23
24
    /**
25
     * Get destination path.
26
     *
27
     * @return string
28
     */
29 1
    public function getDestinationPath()
30
    {
31 1
        return $this->repository->config('paths.migration');
32
    }
33
34
    /**
35
     * Get source path.
36
     *
37
     * @return string
38
     */
39 1
    public function getSourcePath()
40
    {
41 1
        return $this->migrator->getPath();
42
    }
43
}
44