AssetPublisher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 35
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDestinationPath() 0 8 2
A getSourcePath() 0 6 1
1
<?php
2
3
namespace Consigliere\Components\Publishing;
4
5
class AssetPublisher extends Publisher
6
{
7
    /**
8
     * Determine whether the result message will shown in the console.
9
     *
10
     * @var bool
11
     */
12
    protected $showMessage = false;
13
14
    /**
15
     * Get destination path.
16
     *
17
     * @return string
18
     */
19
    public function getDestinationPath()
20
    {
21
        if ($this->repository->config('merge.published-assets')) {
22
            return $this->repository->assetPath('');
23
        }
24
25
        return $this->repository->assetPath($this->component->getLowerName());
0 ignored issues
show
Bug introduced by
The method getLowerName cannot be called on $this->component (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...
26
    }
27
28
    /**
29
     * Get source path.
30
     *
31
     * @return string
32
     */
33
    public function getSourcePath()
34
    {
35
        return $this->getComponent()->getExtraPath(
0 ignored issues
show
Bug introduced by
The method getExtraPath cannot be called on $this->getComponent() (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
            $this->repository->config('paths.generator.assets')
37
        );
38
    }
39
}
40