AbstractBuilder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
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 37
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

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