AbstractFacade::instance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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