GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 86db8e...6747c1 )
by Bob Olde
02:52
created

YouTube_VideoModel::__toString()   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 Craft;
4
5
/**
6
 * YouTube Video Model.
7
 *
8
 * Contains video data.
9
 *
10
 * @author    Bob Olde Hampsink <[email protected]>
11
 * @copyright Copyright (c) 2015, Itmundi
12
 * @license   MIT
13
 *
14
 * @link      http://github.com/boboldehampsink
15
 */
16
class YouTube_VideoModel extends BaseModel
17
{
18
    /**
19
     * YouTube Embed URL prefix.
20
     */
21
    const YOUTUBE_EMBED_PREFIX = 'https://www.youtube.com/embed/';
22
23
    /**
24
     * YouTube Watch URL prefix.
25
     */
26
    const YOUTUBE_WATCH_PREFIX = 'https://www.youtube.com/watch?v=';
27
28
    /**
29
     * Define model attributes.
30
     *
31
     * @return array
32
     */
33
    public function defineAttributes()
34
    {
35
        return array(
36
            'id' => AttributeType::String,
37
        );
38
    }
39
40
    /**
41
     * Return ID as string.
42
     *
43
     * @return string
44
     */
45
    public function __toString()
46
    {
47
        return $this->id;
48
    }
49
50
    /**
51
     * Return full YouTube (embed) url.
52
     *
53
     * @param bool $embed
54
     *
55
     * @return string
56
     */
57
    public function getUrl($embed = true)
58
    {
59
        if ($embed) {
60
            return self::YOUTUBE_EMBED_PREFIX.$this->id;
61
        } else {
62
            return self::YOUTUBE_WATCH_PREFIX.$this->id;
63
        }
64
    }
65
}
66