Language::getSupported()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Crowdin API implementation in PHP.
4
 *
5
 * @copyright  Copyright (C) 2016 Nikolai Plath (elkuku)
6
 * @license    WTFPL - See license.txt
7
 */
8
9
namespace ElKuKu\Crowdin\Package;
10
11
use ElKuKu\Crowdin\Package;
12
13
use Psr\Http\Message\ResponseInterface;
14
15
/**
16
 * Class Language
17
 *
18
 * @since  1.0.5
19
 */
20
Class Language extends Package
21
{
22
	/**
23
	 * Get supported languages list with Crowdin codes mapped to locale name and standardized codes.
24
	 *
25
	 * @since 1.0.5
26
	 * @see https://crowdin.com/page/api/supported-languages
27
	 *
28
	 * @return ResponseInterface
29
	 */
30 1
	public function getSupported() : ResponseInterface
31
	{
32 1
		return $this->getHttpClient()
33 1
			->get('supported-languages');
34
	}
35
36
	/**
37
	 * Get the detailed translation progress for specified language.
38
	 *
39
	 * @param   string  $language  The language code.
40
	 *
41
	 * @since 1.0.5
42
	 * @see https://crowdin.com/page/api/language-status
43
	 *
44
	 * @return ResponseInterface
45
	 */
46 1
	public function getStatus(string $language) : ResponseInterface
47
	{
48 1
		return $this->getHttpClient()
49 1
			->post($this->getBasePath('language-status'), ['form_params' => ['language' => $language]]);
50
	}
51
}
52