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

FacadeInstance   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A instance() 0 3 2
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