PrimaryKeyRenewalController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 29
ccs 8
cts 8
cp 1
rs 10
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __invoke() 0 6 1
1
<?php
2
3
namespace Sausin\Signere\Http\Controllers\Admin;
4
5
use Sausin\Signere\ApiKey;
6
use Illuminate\Support\Facades\Config;
7
use Sausin\Signere\Http\Controllers\Controller;
8
9
class PrimaryKeyRenewalController extends Controller
10
{
11
    /** @var \Sausin\Signere\ApiKey */
12
    protected $key;
13
14
    /**
15
     * Create a new controller instance.
16
     *
17
     * @param  \Sausin\Signere\ApiKey $key
18
     */
19 1
    public function __construct(ApiKey $key)
20
    {
21 1
        parent::__construct();
22
23 1
        $this->key = $key;
24 1
    }
25
26
    /**
27
     * Renew the primary key.
28
     *
29
     * @return \Illuminate\Http\Response
30
     */
31 1
    public function __invoke()
32
    {
33 1
        return $this->key->renewPrimary(Config::get('signere.primary_key'))
34 1
                ->getBody()
35 1
                ->getContents();
36
    }
37
}
38