ResolverFactory::createExistingDeviceResolver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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