Completed
Pull Request — master (#1)
by Saurabh
07:52 queued 06:09
created

Facades   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 7
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFacadeAccessor() 0 4 1
B __callStatic() 0 18 6
1
<?php
2
3
namespace Sausin\Signere;
4
5
use Illuminate\Support\Facades\Facade as IlluminateFacade;
6
7
class Facades extends IlluminateFacade
8
{
9
    /**
10
     * Get the registered name of the component.
11
     *
12
     * @return string
13
     */
14
    protected static function getFacadeAccessor()
15
    {
16
        return 'signere.wrapper';
17
    }
18
19
    /**
20
     * Resolve a new instance.
21
     */
22
    public static function __callStatic($method, $args)
23
    {
24
        $instance = static::$app->make(static::getFacadeAccessor());
25
        switch (count($args)) {
26
            case 0:
27
                return $instance->$method();
28
            case 1:
29
                return $instance->$method($args[0]);
30
            case 2:
31
                return $instance->$method($args[0], $args[1]);
32
            case 3:
33
                return $instance->$method($args[0], $args[1], $args[2]);
34
            case 4:
35
                return $instance->$method($args[0], $args[1], $args[2], $args[3]);
36
            default:
37
                return call_user_func_array([$instance, $method], $args);
38
        }
39
    }
40
}
41