Languageinfo   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 22
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLanguages() 0 3 1
A getLanguage() 0 3 1
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 Language Information class.
10
 *
11
 * @link http://docs.transifex.com/api/language_info/
12
 */
13
final class Languageinfo extends ApiConnector
14
{
15
    /**
16
     * Get data on the specified language.
17
     *
18
     * @param string $lang The language code to retrieve
19
     *
20
     * @return ResponseInterface
21
     */
22 2
    public function getLanguage(string $lang): ResponseInterface
23
    {
24 2
        return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/language/$lang/")));
25
    }
26
27
    /**
28
     * Get data on all supported API languages.
29
     *
30
     * @return ResponseInterface
31
     */
32 2
    public function getLanguages(): ResponseInterface
33
    {
34 2
        return $this->client->sendRequest($this->createRequest('GET', $this->createUri('/api/2/languages/')));
35
    }
36
}
37