StkStatus::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Samerior\MobileMoney\Mpesa\Commands;
4
5
use Samerior\MobileMoney\Mpesa\Repositories\Mpesa;
6
use Illuminate\Console\Command;
7
8
/**
9
 * Class StkStatus
10
 * @package Samerior\MobileMoney\Commands
11
 */
12
class StkStatus extends Command
13
{
14
    /**
15
     * The name and signature of the console command.
16
     *
17
     * @var string
18
     */
19
    protected $signature = 'mpesa:query_status';
20
21
    /**
22
     * The console command description.
23
     *
24
     * @var string
25
     */
26
    protected $description = 'Check status of all pending transactions';
27
    /**
28
     * @var Mpesa
29
     */
30
    private $mpesa;
31
32
    /**
33
     * Create a new command instance.
34
     *
35
     * @param Mpesa $registerUrl
36
     */
37 1
    public function __construct(Mpesa $registerUrl)
38
    {
39 1
        parent::__construct();
40 1
        $this->mpesa = $registerUrl;
41 1
    }
42
43
    /**
44
     * Execute the console command.
45
     *
46
     */
47
    public function handle()
48
    {
49
        $results = $this->mpesa->queryStkStatus();
50
        dd($results);
51
    }
52
}
53