Country::list()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Iamolayemi\Paystack\Endpoints;
4
5
class Country extends Endpoint
6
{
7
    protected const ENDPOINT = '/country';
8
9
    /**
10
     * Gets a list of Countries that Paystack currently supports.
11
     *
12
     * @link https://paystack.com/docs/api/#miscellaneous-bank
13
     */
14
    public function list(): self
15
    {
16
        $this->get($this->url(self::ENDPOINT));
17
18
        return $this;
19
    }
20
21
    /**
22
     * Get a list of states for a country for address verification.
23
     *
24
     * @link https://paystack.com/docs/api/#miscellaneous-avs-states
25
     */
26
    public function states(string $country_code): self
27
    {
28
        $this->get($this->url('/address_verification/states'), ['country' => $country_code]);
29
30
        return $this;
31
    }
32
}
33