VanillaforumsVariable::embeddedOutput()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 * Vanillaforums plugin for Craft CMS 3.x
4
 *
5
 * Single Sign On plugin for VanillaForums/jsConnect and CraftCMS
6
 *
7
 * @link      https://nystudio107.com/
8
 * @copyright Copyright (c) 2019 nystudio107
9
 */
10
11
namespace nystudio107\vanillaforums\variables;
12
13
use nystudio107\vanillaforums\Vanillaforums;
14
15
use craft\helpers\Template;
16
17
/**
18
 * @author    nystudio107
19
 * @package   Vanillaforums
20
 * @since     3.0.0
21
 */
22
class VanillaforumsVariable
23
{
24
    // Public Methods
25
    // =========================================================================
26
27
    /**
28
     * Generate an SSO string suitable for passing in the url for embedded SSO
29
     *
30
     * @param int $userId
31
     *
32
     * @return string
33
     */
34
    public function embeddedOutput(int $userId = 0): string
35
    {
36
        return Template::raw(
37
            Vanillaforums::$plugin->sso->embeddedOutput($userId)
38
        );
39
    }
40
41
    /**
42
     * Return whether we are running Craft 3.1 or later
43
     *
44
     * @return bool
45
     */
46
    public function craft31(): bool
47
    {
48
        return Vanillaforums::$craft31;
49
    }
50
}
51