Completed
Pull Request — master (#40)
by
unknown
03:47 queued 01:55
created

LanguageStatus::getLanguage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Akeneo\Crowdin\Api;
4
5
/**
6
 * Project translation progress by language
7
 *
8
 * @author Pierre Allard <[email protected]>
9
 * @see http://crowdin.net/page/api/language-status
10
 */
11
class LanguageStatus extends AbstractApi
12
{
13
    /** @var string */
14
    protected $language;
15
16
    /**
17
     * @param string $language
18
     *
19
     * @return LanguageStatus
20
     */
21
    public function setLanguage($language)
22
    {
23
        $this->language = $language;
24
25
        return $this;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getLanguage()
32
    {
33
        return $this->language;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function execute()
40
    {
41
        $path = sprintf(
42
            "project/%s/language-status?key=%s",
43
            $this->client->getProjectIdentifier(),
44
            $this->client->getProjectApiKey()
45
        );
46
        $parameters = array_merge($this->parameters, ['language' => $this->getLanguage()]);
47
        $response   = $this->client->getHttpClient()->post($path, $parameters);
48
49
        return $response->getBody(true);
0 ignored issues
show
Unused Code introduced by
The call to ResponseInterface::getBody() has too many arguments starting with true.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
50
    }
51
}
52