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.

Factory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 15 3
1
<?php
2
3
namespace Emarref\Jwt\Encryption;
4
5
use Emarref\Jwt\Algorithm;
6
7
class Factory
8
{
9
    /**
10
     * @param Algorithm\AlgorithmInterface $algorithm
11
     * @return Asymmetric|Symmetric
12
     */
13
    static public function create(Algorithm\AlgorithmInterface $algorithm)
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
14
    {
15
        if ($algorithm instanceof Algorithm\AsymmetricInterface) {
16
            $encryption = new Asymmetric($algorithm);
17
        } elseif ($algorithm instanceof Algorithm\SymmetricInterface) {
18
            $encryption = new Symmetric($algorithm);
19
        } else {
20
            throw new \InvalidArgumentException(sprintf(
21
                'Algorithm of class "%s" is neither symmetric or asymmetric.',
22
                get_class($algorithm)
23
            ));
24
        }
25
26
        return $encryption;
27
    }
28
}
29