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.

RegistrationFactory::createRegistration()   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 1
1
<?php
2
3
namespace Openpp\NotificationHubsRest\Registration;
4
5
class RegistrationFactory
6
{
7
    /**
8
     * Creates the Registration class according to the type.
9
     *
10
     * @param string $type "gcm", "apple"
11
     *
12
     * @throws \RuntimeException
13
     *
14
     * @return RegistrationInterface
15
     */
16
    public function createRegistration($type)
17
    {
18
        $class = __NAMESPACE__.'\\'.ucfirst($type).'Registration';
19
20
        if (!class_exists($class)) {
21
            throw new \RuntimeException('Invalid type: '.$type);
22
        }
23
24
        return new $class();
25
    }
26
}
27