Passed
Push — master ( 617e52...ff4e9f )
by Arthur
35:51
created

RsaKeyPair::getPublicKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 26/10/17
6
 * Time: 14:43
7
 */
8
9
namespace Modules\Script\Support;
10
11
12
class RsaKeyPair
13
{
14
    private $public_key;
15
    private $private_key;
16
17
    /**
18
     * Rsa constructor.
19
     * @param $public_key
20
     * @param $private_key
21
     */
22 11
    public function __construct($public_key, $private_key)
23
    {
24 11
        $this->public_key = $public_key;
25 11
        $this->private_key = $private_key;
26 11
    }
27
28
    /**
29
     * @return mixed
30
     */
31 11
    public function getPublicKey()
32
    {
33 11
        return $this->public_key;
34
    }
35
36
    /**
37
     * @return mixed
38
     */
39 11
    public function getPrivateKey()
40
    {
41 11
        return $this->private_key;
42
    }
43
44
    public function toArray()
45
    {
46
        return [
47
            "public_key" => $this->getPublicKey(),
48
            "private_key" => $this->getPrivateKey()
49
        ];
50
    }
51
52
53
}
54