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.
Completed
Push — master ( 16bc05...356550 )
by sebastian
03:03
created

SymmetricSharedKey::getFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Copyright 2015 OpenStack Foundation
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 * Unless required by applicable law or agreed to in writing, software
9
 * distributed under the License is distributed on an "AS IS" BASIS,
10
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
 * See the License for the specific language governing permissions and
12
 * limitations under the License.
13
 **/
14
15
namespace security;
16
17
use jwk\JSONWebKeyTypes;
18
use utils\ByteUtil;
19
20
/**
21
 * Class SymmetricSharedKey
22
 * @package security
23
 */
24
final class SymmetricSharedKey
25
    implements PrivateKey, SharedKey {
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
26
27
    /**
28
     * @param string $secret
29
     */
30
    public function __construct($secret){
31
        $this->secret = $secret;
32
    }
33
34
    private $secret = null;
35
36
    /**
37
     * @return string
38
     */
39
    public function getAlgorithm()
40
    {
41
        return JSONWebKeyTypes::OctetSequence;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getEncoded()
48
    {
49
       return $this->getSecret();
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getFormat()
56
    {
57
        return JSONWebKeyTypes::OctetSequence;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getBitLength()
64
    {
65
        return ByteUtil::bitLength(strlen($this->secret));
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getSecret()
72
    {
73
       return $this->secret;
74
    }
75
}