PayloadFactory   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 42
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A createCombinedPayload() 0 4 1
A createDataPayload() 0 4 1
A createNotificationAndroidPayload() 0 4 1
A createNotificationIosPayload() 0 4 1
A createNotificationWebPayload() 0 4 1
1
<?php
2
/*
3
 * This file is part of the FirebaseCloudMessagingBundle.
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload;
14
15
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Combined\CombinedPayload;
16
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Data\DataPayload;
17
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Notification\AndroidNotificationPayload;
18
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Notification\IosNotificationPayload;
19
use Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Notification\WebNotificationPayload;
20
21
/**
22
 * PayloadFactory.
23
 *
24
 * @author Artem Henvald <[email protected]>
25
 */
26
class PayloadFactory
27
{
28
    /**
29
     * @return CombinedPayload
30
     */
31
    public static function createCombinedPayload(): CombinedPayload
32
    {
33
        return new CombinedPayload();
34
    }
35
36
    /**
37
     * @return DataPayload
38
     */
39
    public static function createDataPayload(): DataPayload
40
    {
41
        return new DataPayload();
42
    }
43
44
    /**
45
     * @return AndroidNotificationPayload
46
     */
47
    public static function createNotificationAndroidPayload(): AndroidNotificationPayload
48
    {
49
        return new AndroidNotificationPayload();
50
    }
51
52
    /**
53
     * @return IosNotificationPayload
54
     */
55
    public static function createNotificationIosPayload(): IosNotificationPayload
56
    {
57
        return new IosNotificationPayload();
58
    }
59
60
    /**
61
     * @return WebNotificationPayload
62
     */
63
    public static function createNotificationWebPayload(): WebNotificationPayload
64
    {
65
        return new WebNotificationPayload();
66
    }
67
}
68