Statistics::getStatistics()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace BabDev\Transifex\Connector;
4
5
use BabDev\Transifex\ApiConnector;
6
use Psr\Http\Message\ResponseInterface;
7
8
/**
9
 * Transifex API Statistics class.
10
 *
11
 * @link http://docs.transifex.com/api/statistics/
12
 */
13
final class Statistics extends ApiConnector
14
{
15
    /**
16
     * Get statistics on a specified resource.
17
     *
18
     * @param string $project  The slug for the project to pull from
19
     * @param string $resource The slug for the resource to pull from
20
     * @param string $lang     An optional language code to return data only for a specified language
21
     *
22
     * @return ResponseInterface
23
     */
24 2
    public function getStatistics(string $project, string $resource, string $lang = ''): ResponseInterface
25
    {
26 2
        return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/project/$project/resource/$resource/stats/$lang")));
27
    }
28
}
29