GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

NotificationFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createNotification() 0 10 2
1
<?php
2
3
namespace Openpp\NotificationHubsRest\Notification;
4
5
class NotificationFactory
6
{
7
    /**
8
     * Creates the Notification class according to the format.
9
     *
10
     * @param string       $format              "gcm", "apple", "template"
11
     * @param string|array $alert               "data" for gcm, "alert" for apple, payload for template
12
     * @param array        $options             message options
13
     * @param string|array $tagsOrTagExpression a tag or tags array or tag expression
14
     * @param \DateTime    $scheduleTime        the date to deliver the notification at
15
     *
16
     * @throws \RuntimeException
17
     *
18
     * @return NotificationInterface
19
     */
20
    public function createNotification($format, $alert, array $options = [], $tagsOrTagExpression = '', \DateTime $scheduleTime = null)
21
    {
22
        $class = __NAMESPACE__.'\\'.ucfirst($format).'Notification';
23
24
        if (!class_exists($class)) {
25
            throw new \RuntimeException('Invalid format: '.$format);
26
        }
27
28
        return new $class($alert, $options, $tagsOrTagExpression, $scheduleTime);
29
    }
30
}
31