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

ResolverFactory   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 6
dl 0
loc 44
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createAppResolver() 0 4 1
A createDeviceSessionResolver() 0 4 1
A createDevicePurchaseResolver() 0 4 1
A createDeviceFocusResolver() 0 4 1
A createNewDeviceResolver() 0 4 1
A createExistingDeviceResolver() 0 4 1
A createNotificationResolver() 0 4 1
1
<?php
2
3
namespace OneSignal\Resolver;
4
5
use OneSignal\Config;
6
7
class ResolverFactory
8
{
9
    private $config;
10
11
    public function __construct(Config $config)
12
    {
13
        $this->config = $config;
14
    }
15
16
    public function createAppResolver()
17
    {
18
        return new AppResolver();
19
    }
20
21
    public function createDeviceSessionResolver()
22
    {
23
        return new DeviceSessionResolver();
24
    }
25
26
    public function createDevicePurchaseResolver()
27
    {
28
        return new DevicePurchaseResolver();
29
    }
30
31
    public function createDeviceFocusResolver()
32
    {
33
        return new DeviceFocusResolver();
34
    }
35
36
    public function createNewDeviceResolver()
37
    {
38
        return new DeviceResolver($this->config, true);
39
    }
40
41
    public function createExistingDeviceResolver()
42
    {
43
        return new DeviceResolver($this->config, false);
44
    }
45
46
    public function createNotificationResolver()
47
    {
48
        return new NotificationResolver($this->config);
49
    }
50
}
51