App::stats()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Authy;
6
7
class App extends Client
8
{
9
    /**
10
     * Return application stats.
11
     *
12
     * @param string|null $ip
13
     *
14
     * @return \Rinvex\Authy\Response
15
     */
16
    public function stats($ip = null): Response
17
    {
18
        // Prepare required variables
19
        $url = $this->api.'app/stats';
20
        $params = $this->params + ['query' => ['user_ip' => $ip]];
21
22
        // Return Authy application stats
23
        return new Response($this->http->get($url, $params));
24
    }
25
26
    /**
27
     * Get application details.
28
     *
29
     * @param string|null $ip
30
     *
31
     * @return \Rinvex\Authy\Response
32
     */
33
    public function details($ip = null): Response
34
    {
35
        // Prepare required variables
36
        $url = $this->api.'app/details';
37
        $params = $this->params + ['query' => ['user_ip' => $ip]];
38
39
        // Return Authy application stats
40
        return new Response($this->http->get($url, $params));
41
    }
42
}
43