AbstractFacade   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 31
rs 10
c 4
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A instance() 0 3 1
A __callStatic() 0 4 1
1
<?php
2
3
namespace Lagdo\Symfony\Facades;
4
5
abstract class AbstractFacade
6
{
7
    /**
8
     * Get the service identifier.
9
     *
10
     * @return string
11
     */
12
    abstract protected static function getServiceIdentifier(): string;
13
14
    /**
15
     * Get the service instance.
16
     *
17
     * @return mixed
18
     */
19
    public static function instance()
20
    {
21
        return Container::getFacadeService(static::getServiceIdentifier());
22
    }
23
24
    /**
25
     * Call the service.
26
     *
27
     * @param string $method
28
     * @param array  $arguments
29
     *
30
     * @return mixed
31
     */
32
    public static function __callStatic(string $method, array $arguments)
33
    {
34
        // Get the instance and call the method.
35
        return self::instance()->$method(...$arguments);
36
    }
37
}
38