Passed
Push — develop ( 749cf8...d507c0 )
by Andrew
03:42
created

DisqusVariable::craft31()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Disqus plugin for Craft CMS 3.x
4
 *
5
 * Integrates the Disqus commenting system into Craft 3 websites, including
6
 * Single Sign On (SSO) and custom login/logout URLs
7
 *
8
 * @link      https://nystudio107.com
0 ignored issues
show
Coding Style introduced by
The tag in position 1 should be the @copyright tag
Loading history...
9
 * @copyright Copyright (c) 2017 nystudio107
0 ignored issues
show
Coding Style introduced by
@copyright tag must contain a year and the name of the copyright holder
Loading history...
10
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
Coding Style introduced by
Missing @license tag in file comment
Loading history...
11
12
namespace nystudio107\disqus\variables;
13
14
use nystudio107\disqus\Disqus;
15
16
/**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
17
 * @author    nystudio107
0 ignored issues
show
Coding Style introduced by
The tag in position 1 should be the @package tag
Loading history...
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
Coding Style introduced by
Tag value for @author tag indented incorrectly; expected 2 spaces but found 4
Loading history...
18
 * @package   Disqus
0 ignored issues
show
Coding Style introduced by
Tag value for @package tag indented incorrectly; expected 1 spaces but found 3
Loading history...
19
 * @since     1.0.0
0 ignored issues
show
Coding Style introduced by
The tag in position 3 should be the @author tag
Loading history...
Coding Style introduced by
Tag value for @since tag indented incorrectly; expected 3 spaces but found 5
Loading history...
20
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
21
class DisqusVariable
22
{
23
    // Public Methods
24
    // =========================================================================
25
26
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
27
     * @param string $disqusIdentifier
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
28
     * @param string $disqusTitle
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
29
     * @param string $disqusUrl
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
30
     * @param string $disqusCategoryId
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
31
     * @param string $disqusLanguage
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
32
     *
33
     * @return string
34
     */
35
    public function disqusEmbed(
36
        $disqusIdentifier = "",
37
        $disqusTitle = "",
38
        $disqusUrl = "",
39
        $disqusCategoryId = "",
40
        $disqusLanguage = ""
41
    ) {
42
        return Disqus::$plugin->disqusService->outputEmbedTag(
43
            $disqusIdentifier,
44
            $disqusTitle,
45
            $disqusUrl,
46
            $disqusCategoryId,
47
            $disqusLanguage
48
        );
49
    }
50
51
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
52
     * @param string $disqusIdentifier
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
53
     *
54
     * @return int
55
     */
56
    public function disqusCount(
57
        $disqusIdentifier = ""
58
    ) {
59
        return Disqus::$plugin->disqusService->getCommentsCount(
60
            $disqusIdentifier
61
        );
62
    }
63
64
    /**
65
     * Return whether we are running Craft 3.1 or later
66
     *
67
     * @return bool
68
     */
69
    public function craft31(): bool
70
    {
71
        return Disqus::$craft31;
72
    }
73
}
74