Passed
Push — master ( 48d02b...1e0cee )
by Austin
03:14
created

SecurityTxtFacade::__callStatic()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 1
nop 2
1
<?php
2
/**
3
 * src/SecurityTxtFacade.php.
4
 *
5
 * @author      Austin Heap <[email protected]>
6
 * @version     v0.3.2
7
 */
8
declare(strict_types = 1);
9
10
namespace AustinHeap\Security\Txt;
11
12
use RuntimeException;
13
14
/**
15
 * SecurityTxtFacade.
16
 *
17
 * @link        https://github.com/austinheap/laravel-security-txt
18
 * @link        https://packagist.org/packages/austinheap/laravel-security-txt
19
 * @link        https://austinheap.github.io/laravel-security-txt/classes/AustinHeap.Security.Txt.SecurityTxtFacade.html
20
 */
21
class SecurityTxtFacade extends \Illuminate\Support\Facades\Facade
22
{
23
    /**
24
     * Get the registered name of the component.
25
     *
26
     * @return string
27
     */
28
    protected static function getFacadeAccessor()
29
    {
30
        return 'SecurityTxt';
31
    }
32
33
    /**
34
     * Handle dynamic, static calls to the object.
35
     *
36
     * @param  string $method
37
     * @param  array  $args
38
     *
39
     * @return mixed
40
     * @throws RuntimeException
41
     */
42
    public static function __callStatic($method, $args)
43
    {
44
        $instance = static::getFacadeRoot();
45
46
        if (!$instance) {
47
            throw new RuntimeException('A facade root has not been set.');
48
        }
49
50
        return $instance->$method(...$args);
51
    }
52
}
53