CopyRootMixFile   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 39
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
A getStub() 0 5 1
1
<?php namespace Arcanedev\Assets\Pipes\Init;
2
3
use Arcanedev\Assets\Helpers\Stub;
4
use Closure;
5
6
/**
7
 * Class     CopyRootMixFile
8
 *
9
 * @package  Arcanedev\Assets\Pipes\Init
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class CopyRootMixFile extends AbstractPipe
13
{
14
    /* -----------------------------------------------------------------
15
     |  Main Method
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * @param  array     $passable
21
     * @param  \Closure  $next
22
     *
23
     * @return mixed
24
     */
25
    public function handle(array $passable, Closure $next)
26
    {
27
        $this->getStub($passable)
28
             ->save(base_path('webpack.mix.js'));
29
30
        return $next($passable);
31
    }
32
33
    /* -----------------------------------------------------------------
34
     |  Other Methods
35
     | -----------------------------------------------------------------
36
     */
37
38
    /**
39
     * Get the stub.
40
     *
41
     * @param  array  $passable
42
     *
43
     * @return \Arcanedev\Assets\Helpers\Stub
44
     */
45
    protected function getStub(array $passable)
46
    {
47
        return Stub::make('init/webpack.mix.stub')
48
                   ->replace('{{root}}', $passable['root-directory']);
49
    }
50
}
51