Completed
Push — master ( c0df30...f1cec2 )
by Nikolai
02:52
created

Language   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 1
cbo 2
dl 0
loc 32
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    GNU General Public License version 2 or later
7
 */
8
9
namespace ElKuKu\Crowdin\Package;
10
11
use ElKuKu\Crowdin\Package;
12
13
/**
14
 * Class Language
15
 *
16
 * @since  1.0.5
17
 */
18
Class Language extends Package
19
{
20
	/**
21
	 * Get supported languages list with Crowdin codes mapped to locale name and standardized codes.
22
	 *
23
	 * @since 1.0.5
24
	 * @see https://crowdin.com/page/api/supported-languages
25
	 *
26
	 * @return \Psr\Http\Message\ResponseInterface
27
	 */
28
	public function getSupported()
29
	{
30
		return $this->getHttpClient()
31
			->get('supported-languages');
32
	}
33
34
	/**
35
	 * Get the detailed translation progress for specified language.
36
	 *
37
	 * @param   string  $language  The language code.
38
	 *
39
	 * @since 1.0.5
40
	 * @see https://crowdin.com/page/api/language-status
41
	 *
42
	 * @return \Psr\Http\Message\ResponseInterface
43
	 */
44
	public function getStatus($language)
45
	{
46
		return $this->getHttpClient()
47
			->post($this->getBasePath('language-status'), ['form_params' => ['language' => $language]]);
48
	}
49
}
50