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::createNotification()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 5
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