Passed
Pull Request — master (#309)
by Jason
04:58
created

OrderHistoryPageController::Index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Dynamic\FoxyStripe\Page;
4
5
use SilverStripe\Security\Security;
6
7
class OrderHistoryPageController extends \PageController
8
{
9
    /**
10
     * @var array
11
     */
12
    private static $allowed_actions = array(
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
13
        'index',
14
    );
15
16
    /**
17
     * @return bool|\SilverStripe\Control\HTTPResponse
18
     */
19
    public function checkMember()
20
    {
21
        if (Security::getCurrentUser()) {
22
            return true;
23
        } else {
24
            return Security::permissionFailure($this, _t(
25
                'AccountPage.CANNOTCONFIRMLOGGEDIN',
26
                'Please login to view this page.'
27
            ));
28
        }
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function Index()
35
    {
36
        $this->checkMember();
37
38
        return array();
39
    }
40
}
41