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

LangPublisher::getDestinationPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Nwidart\Modules\Publishing;
4
5
use Nwidart\Modules\Support\Config\GenerateConfigReader;
6
7
class LangPublisher extends Publisher
8
{
9
    /**
10
     * Determine whether the result message will shown in the console.
11
     *
12
     * @var bool
13
     */
14
    protected $showMessage = false;
15
16
    /**
17
     * Get destination path.
18
     *
19
     * @return string
20
     */
21
    public function getDestinationPath()
22
    {
23
        $name = $this->module->getLowerName();
0 ignored issues
show
Bug introduced by
The method getLowerName cannot be called on $this->module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
24
25
        return base_path("resources/lang/{$name}");
26
    }
27
28
    /**
29
     * Get source path.
30
     *
31
     * @return string
32
     */
33
    public function getSourcePath()
34
    {
35
        return $this->getModule()->getExtraPath(
0 ignored issues
show
Bug introduced by
The method getExtraPath cannot be called on $this->getModule() (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
36
            GenerateConfigReader::read('lang')->getPath()
37
        );
38
    }
39
}
40