Completed
Push — master ( a7c5f9...ae6cde )
by Andrii
02:34
created

AnyTarget::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\target;
12
13
/**
14
 * @author Andrii Vasyliev <[email protected]>
15
 */
16
class AnyTarget extends AbstractTarget
17
{
18
    private static $instance;
19
20
    public function __construct()
21
    {
22
        parent::__construct(self::ANY, self::ANY);
23
    }
24
25
    public static function get(): self
26
    {
27
        if (self::$instance === null) {
28
            self::$instance = new self();
29
        }
30
31
        return self::$instance;
32
    }
33
}
34