Passed
Push — v2.0 ( d79b43...27e8f8 )
by Raza
09:44 queued 14s
created

Helpers   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setupOrderConfirmation() 0 9 1
1
<?php
2
3
namespace Srmklive\PayPal\Traits\PayPalAPI\Orders;
4
5
use Throwable;
6
7
trait Helpers
8
{
9
    /**
10
     * Confirm payment for an order.
11
     *
12
     * @param string $order_id
13
     * @param string $processing_instruction
14
     *
15
     * @throws Throwable
16
     *
17
     * @return array|\Psr\Http\Message\StreamInterface|string
18
     */
19
    public function setupOrderConfirmation(string $order_id, string $processing_instruction = '')
20
    {
21
        $body = [
22
            'processing_instruction' => $processing_instruction,
23
            'application_context'    => $this->experience_context,
24
            'payment_source'         => $this->payment_source,
25
        ];
26
27
        return $this->confirmOrder($order_id, $body);
0 ignored issues
show
Bug introduced by
It seems like confirmOrder() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return $this->/** @scrutinizer ignore-call */ confirmOrder($order_id, $body);
Loading history...
28
    }
29
}
30