Completed
Push — master ( 9bb41e...bd50f4 )
by Orkhan
01:11
created

ResultCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
1
<?php
2
3
namespace Orkhanahmadov\LaravelGoldenpay\Commands;
4
5
use Illuminate\Console\Command;
6
use Orkhanahmadov\LaravelGoldenpay\Goldenpay;
7
use Orkhanahmadov\LaravelGoldenpay\Models\Payment;
8
9
class ResultCommand extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'goldenpay:result {paymentKey?}';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Checks payment result for given or all pending payments';
24
25
    /**
26
     * Execute the console command.
27
     *
28
     * @param Goldenpay $goldenpay
29
     */
30
    public function handle(Goldenpay $goldenpay): void
31
    {
32
        $payment = Payment::wherePaymentKey($this->argument('paymentKey'))->firstOrFail();
33
34
        $goldenpay->result($payment);
35
    }
36
}
37