Passed
Push — master ( 3e7456...bf1b04 )
by Raza
01:44
created

Adjustments   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A adjust_subscription_balance() 0 14 1
1
<?php
2
3
namespace Srmklive\Chargify\Traits\ChargifyAPI;
4
5
trait Adjustments
6
{
7
    /**
8
     * Create an adjustment for a subscription.
9
     *
10
     * @param int    $subscription_id
11
     * @param int    $amount
12
     * @param string $memo
13
     *
14
     * @return array
15
     */
16
    public function adjust_subscription_balance($subscription_id, $amount, $memo): array
17
    {
18
        $this->options['json'] = [
0 ignored issues
show
Bug Best Practice introduced by
The property options does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
19
            'adjustment' => [
20
                'amount' => $amount,
21
                'memo'   => $memo,
22
            ]
23
        ];
24
25
        $this->apiEndPoint = "/subscriptions/{$subscription_id}/adjustments.json";
26
27
        $this->verb = 'post';
28
29
        return $this->doChargifyRequest();
0 ignored issues
show
Bug introduced by
It seems like doChargifyRequest() 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

29
        return $this->/** @scrutinizer ignore-call */ doChargifyRequest();
Loading history...
30
    }
31
}
32