OrderHistoryPageController::checkMember()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 10
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Dynamic\FoxyStripe\Page;
4
5
use SilverStripe\Security\Security;
6
7
/**
8
 * Class OrderHistoryPageController
9
 * @package Dynamic\FoxyStripe\Page
10
 *
11
 * @mixin OrderHistoryPage
12
 */
13
class OrderHistoryPageController extends \PageController
14
{
15
    /**
16
     * @var array
17
     */
18
    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...
19
        'index',
20
    );
21
22
    /**
23
     * @return bool|\SilverStripe\Control\HTTPResponse
24
     */
25
    public function checkMember()
26
    {
27
        if (Security::getCurrentUser()) {
28
            return true;
29
        } else {
30
            return Security::permissionFailure($this, _t(
31
                'AccountPage.CANNOTCONFIRMLOGGEDIN',
32
                'Please login to view this page.'
33
            ));
34
        }
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function Index()
41
    {
42
        $this->checkMember();
43
44
        return array();
45
    }
46
}
47