Completed
Pull Request — master (#74)
by
unknown
01:26
created

ResolverFactory::createExistingDeviceResolver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace OneSignal\Resolver;
4
5
use OneSignal\Config;
6
7
class ResolverFactory
8
{
9
    /**
10
     * @var Config
11
     */
12
    private $config;
13
14
    /**
15
     * ResolverFactory constructor.
16
     *
17
     * @param Config $config
18
     */
19
    public function __construct(Config $config)
20
    {
21
        $this->config = $config;
22
    }
23
24
    public function createAppResolver()
25
    {
26
        return new AppResolver();
27
    }
28
29
    public function createDeviceSessionResolver()
30
    {
31
        return new DeviceSessionResolver();
32
    }
33
34
    public function createDevicePurchaseResolver()
35
    {
36
        return new DevicePurchaseResolver();
37
    }
38
39
    public function createDeviceFocusResolver()
40
    {
41
        return new DeviceFocusResolver();
42
    }
43
44
    public function createNewDeviceResolver()
45
    {
46
        return new DeviceResolver($this->config, true);
47
    }
48
49
    public function createExistingDeviceResolver()
50
    {
51
        return new DeviceResolver($this->config, false);
52
    }
53
54
    public function createNotificationResolver()
55
    {
56
        return new NotificationResolver($this->config);
57
    }
58
}
59