Passed
Push — develop ( e969b4...010249 )
by Andrew
04:23
created

RetourVariable::craft31()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Retour plugin for Craft CMS 3.x
4
 *
5
 * Retour allows you to intelligently redirect legacy URLs, so that you don't
6
 * lose SEO value when rebuilding & restructuring a website
7
 *
8
 * @link      https://nystudio107.com/
9
 * @copyright Copyright (c) 2018 nystudio107
10
 */
11
12
namespace nystudio107\retour\variables;
13
14
use nystudio107\retour\Retour;
15
16
/**
17
 * @author    nystudio107
18
 * @package   Retour
19
 * @since     3.0.0
20
 */
21
class RetourVariable extends ManifestVariable
22
{
23
    // Public Methods
24
    // =========================================================================
25
26
    /**
27
     * Returns the list of matching schemes
28
     *
29
     * @return array
30
     */
31
    public function getMatchesList(): array
32
    {
33
        return Retour::$plugin->redirects->getMatchesList();
34
    }
35
36
    /**
37
     * Return the http status code
38
     *
39
     * @return int
40
     */
41
    public function getHttpStatus(): int
42
    {
43
        return http_response_code();
44
    }
45
46
    /**
47
     * Return whether we are running Craft 3.1 or later
48
     *
49
     * @return bool
50
     */
51
    public function craft31(): bool
52
    {
53
        return Retour::$craft31;
54
    }
55
56
}
57