TwitchParser::defaultQueries()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
c 1
b 0
f 0
ccs 2
cts 2
cp 1
rs 9.4285
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php namespace Arcanedev\EmbedVideo\Parsers;
2
3
/**
4
 * Class     TwitchParser
5
 *
6
 * @package  Arcanedev\EmbedVideo\Parsers
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class TwitchParser extends AbstractParser
10
{
11
    /* -----------------------------------------------------------------
12
     |  Getters & Setters
13
     | -----------------------------------------------------------------
14
     */
15
    /**
16
     * Get the default URL queries.
17
     *
18
     * @return array
19
     */
20 21
    protected function defaultQueries()
21
    {
22
        return [
23
            //
24 21
        ];
25
    }
26
27
    /**
28
     * Get the iframe pattern.
29
     *
30
     * @return string
31
     */
32 3
    protected function getIframePattern()
33
    {
34 3
        $this->prependQuery('video', 'v'.$this->videoId());
35
36 3
        return 'https://player.twitch.tv/';
37
    }
38
39
    /**
40
     * Get the iframe replace.
41
     *
42
     * @return array
43
     */
44 3
    protected function getIframeReplacer()
45
    {
46
        return [
47
            //
48 3
        ];
49
    }
50
51
    /**
52
     * Get the video id.
53
     *
54
     * @return mixed
55
     */
56 9
    public function videoId()
57
    {
58 9
        return $this->getCached(2);
59
    }
60
61
    /**
62
     * Get the info URL.
63
     *
64
     * @return string
65
     */
66 3
    public function getInfoUrl()
67
    {
68 3
        return $this->protocol.'://twitch.tv/videos/'.$this->videoId();
69
    }
70
}
71