Setup::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
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