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

Getters::getCN()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 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