Newsfeed::pipeline()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 14
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 14
loc 14
rs 9.4285
cc 3
eloc 7
nc 3
nop 2
1
<?php
2
3
namespace Streak\Endpoint;
4
5
class Newsfeed extends AbstractEndpoint
6
{
7
    const ENDPOINT = 'newsfeed';
8
9 View Code Duplication
    public function pipeline($pipelineKey, $detailLevel = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
    {
11
        $options = [];
12
13
        if (null !== $detailLevel) {
14
            if (!in_array($detailLevel, ['ALL', 'CONDENSED'])) {
15
                throw new \InvalidArgumentException('Invalid detail field.');
16
            }
17
18
            $options['query'] = ['detailLevel' => $detailLevel];
19
        }
20
21
        return $this->client->get(sprintf('pipelines/%s/%s', $pipelineKey, self::ENDPOINT), $options);
22
    }
23
24 View Code Duplication
    public function box($boxKey, $detailLevel = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $options = [];
27
28
        if (null !== $detailLevel) {
29
            if (!in_array($detailLevel, ['ALL', 'CONDENSED'])) {
30
                throw new \InvalidArgumentException('Invalid detail field.');
31
            }
32
33
            $options['query'] = ['detailLevel' => $detailLevel];
34
        }
35
36
        return $this->client->get(sprintf('boxes/%s/%s', $boxKey, self::ENDPOINT), $options);
37
    }
38
39 View Code Duplication
    public function all($detailLevel = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
40
    {
41
        $options = [];
42
43
        if (null !== $detailLevel) {
44
            if (!in_array($detailLevel, ['ALL', 'CONDENSED'])) {
45
                throw new \InvalidArgumentException('Invalid detail field.');
46
            }
47
48
            $options['query'] = ['detailLevel' => $detailLevel];
49
        }
50
51
        return $this->client->get(self::ENDPOINT, $options);
52
    }
53
}
54