Completed
Push — master ( 15c045...db382d )
by Chris
03:05 queued 53s
created

Getters   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 28
ccs 11
cts 11
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getMD5() 0 4 1
A getSHA1() 0 4 1
A getEndpoint() 0 4 1
A getCN() 0 5 1
A getCSR() 0 4 1
1
<?php
2
/**
3
 * @author     Chris Hilsdon <[email protected]>
4
 * @package    ComodoDecodeCSR
5
 * @copyright  2016 Xigen
6
 * @license    GNU General Public License v3
7
 * @link       https://github.com/XigenChris/ComodoDecodeCSR
8
 */
9
10
namespace Xigen\Traits\ComodoDecodeCSR;
11
12
trait Getters
13
{
14 3
    public function getMD5()
15
    {
16 3
        return $this->MD5;
17
    }
18
19 7
    public function getSHA1()
20
    {
21 7
        return $this->SHA1;
22
    }
23
24 9
    public function getEndpoint()
25
    {
26 9
        return $this->Endpoint;
27
    }
28
29 2
    public function getCN()
30
    {
31 2
        $CSRInfo = $this->decodeCSR();
0 ignored issues
show
Bug introduced by
It seems like decodeCSR() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
32 2
        return $CSRInfo['subject']['CN'];
33
    }
34
35 3
    public function getCSR()
36
    {
37 3
        return $this->CSR;
38
    }
39
}
40