Completed
Pull Request — master (#29)
by Hugo
01:27
created

Statistics::callTracking()   B

Complexity

Conditions 9
Paths 40

Size

Total Lines 50

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 50
rs 7.5353
c 0
b 0
f 0
cc 9
nc 40
nop 12

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yproximite\WannaSpeakBundle\Api;
6
7
use Yproximite\WannaSpeakBundle\HttpClientInterface;
8
9
class Statistics implements StatisticsInterface
10
{
11
    private $client;
12
13
    public function __construct(HttpClientInterface $client)
14
    {
15
        $this->client = $client;
16
    }
17
18
    public function did(array $additionalArguments = []): array
19
    {
20
        $response = $this->client->request(self::API, 'did', $additionalArguments);
21
22
        return $response->toArray(); // @phpstan-ignore-line
23
    }
24
}
25