Setup::getInstance()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
namespace Perry;
3
4
use Perry\Cache\NoCache\NoCachePool;
5
use Perry\Fetcher\GuzzleFetcher;
6
7
final class Setup
8
{
9
    /**
10
     * @var Setup
11
     */
12
    private static $myInstance;
13
14
    /**
15
     * @var \Perry\Fetcher\CanFetch
16
     */
17
    public $fetcher;
18
19
    /**
20
     * @var \Psr\Cache\PoolInterface
21
     */
22
    public $cacheImplementation;
23
24
    /**
25
     * singleton implementation
26
     * @return Setup
27
     */
28
    public static function getInstance()
29
    {
30
        if (!isset(self::$myInstance)) {
31
            self::$myInstance = new Setup();
32
        }
33
        return self::$myInstance;
34
    }
35
36
    /**
37
     * private constructor (singleton, creates defaults)
38
     */
39
    private function __construct()
40
    {
41
        $this->fetcher = new GuzzleFetcher();
42
        $this->cacheImplementation = new NoCachePool();
43
    }
44
45
    public static $crestUrl = "http://public-crest.eveonline.com";
46
    public static $thoraUrl = "http://thora.3rdpartyeve.net";
47
    public static $bindToIp = "0.0.0.0:0";
48
    public static $cacheTTL = 300; // 5 minutes default
49
    public static $userAgent = "( Unknown PHP Application )";
50
51
    /**
52
     * @var array can be used to pass additional options to the fetcher
53
     */
54
    public static $fetcherOptions = [];
55
}
56