Language   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 32
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupported() 0 5 1
A getStatus() 0 5 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