Passed
Push — main ( b7523c...b6bce9 )
by Thierry
09:12
created

FacadeInstance::instance()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Lagdo\Symfony\Facades;
4
5
trait FacadeInstance
6
{
7
    /**
8
     * The service instance.
9
     *
10
     * @var mixed
11
     */
12
    private static $_serviceInstance = null;
13
14
    /**
15
     * Get the service instance.
16
     * Overrides the default method, calls the container once, and saves the service instance locally.
17
     *
18
     * @return mixed
19
     */
20
    public static function instance()
21
    {
22
        return self::$_serviceInstance ?: self::$_serviceInstance = parent::instance();
23
    }
24
}
25