TwitterStreamingApi::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\LaravelTwitterStreamingApi;
4
5
use Spatie\TwitterStreamingApi\UserStream;
6
use Illuminate\Contracts\Config\Repository;
7
use Spatie\TwitterStreamingApi\PublicStream;
8
9
class TwitterStreamingApi
10
{
11
    /** @var array */
12
    protected $config;
13
14
    public function __construct(Repository $config)
15
    {
16
        $this->config = $config['laravel-twitter-streaming-api'];
17
    }
18
19 View Code Duplication
    public function publicStream(): PublicStream
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...
20
    {
21
        return new PublicStream(
22
            $this->config['access_token'],
23
            $this->config['access_token_secret'],
24
            $this->config['consumer_key'],
25
            $this->config['consumer_secret']
26
        );
27
    }
28
29 View Code Duplication
    public function userStream(): UserStream
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...
30
    {
31
        return new UserStream(
32
            $this->config['access_token'],
33
            $this->config['access_token_secret'],
34
            $this->config['consumer_key'],
35
            $this->config['consumer_secret']
36
        );
37
    }
38
}
39