Issues (27)

src/Traits/ChargifyAPI/Adjustments.php (2 issues)

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
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