SecurityTxtFacade   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFacadeAccessor() 0 3 1
A __callStatic() 0 9 2
1
<?php
2
/**
3
 * src/SecurityTxtFacade.php.
4
 *
5
 * @author      Austin Heap <[email protected]>
6
 * @version     v0.4.0
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
 * @link        https://securitytext.org/
21
 */
22
class SecurityTxtFacade extends \Illuminate\Support\Facades\Facade
23
{
24
    /**
25
     * Get the registered name of the component.
26
     *
27
     * @return string
28
     */
29 3
    protected static function getFacadeAccessor()
30
    {
31 3
        return 'SecurityTxt';
32
    }
33
34
    /**
35
     * Handle dynamic, static calls to the object.
36
     *
37
     * @param  string $method
38
     * @param  array  $args
39
     *
40
     * @return mixed
41
     * @throws RuntimeException
42
     */
43 2
    public static function __callStatic($method, $args)
44
    {
45 2
        $instance = static::getFacadeRoot();
46
47 2
        if (! $instance) {
48 1
            throw new RuntimeException('A facade root has not been set.');
49
        }
50
51 1
        return $instance->$method(...$args);
52
    }
53
}
54