Completed
Push — master ( 101081...c2c5eb )
by ARCANEDEV
23s queued 10s
created

AbstractBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __call() 0 11 2
1
<?php namespace Arcanedev\LaravelHtml;
2
3
use Arcanedev\LaravelHtml\Traits\Componentable;
4
use BadMethodCallException;
5
use Illuminate\Support\Traits\Macroable;
6
7
/**
8
 * Class     AbstractBuilder
9
 *
10
 * @package  Arcanedev\LaravelHtml
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
abstract class AbstractBuilder
14
{
15
    /* -----------------------------------------------------------------
16
     |  Traits
17
     | -----------------------------------------------------------------
18
     */
19
20
    use Macroable, Componentable {
21
        Macroable::__call     as macroCall;
22
        Componentable::__call as componentCall;
23
    }
24
25
    /* -----------------------------------------------------------------
26
     |  Main Methods
27
     | -----------------------------------------------------------------
28
     */
29
30
    /**
31
     * Dynamically handle calls to the class.
32
     *
33
     * @param  string  $method
34
     * @param  array   $parameters
35
     *
36
     * @return mixed
37
     *
38
     * @throws \BadMethodCallException
39
     */
40 4
    public function __call($method, $parameters)
41
    {
42
        try {
43 4
            return $this->componentCall($method, $parameters);
44
        }
45 2
        catch (BadMethodCallException $e) {
46
            // Continue
47
        }
48
49 2
        return $this->macroCall($method, $parameters);
50
    }
51
}
52