Completed
Push — master ( f8f77e...d2a4ab )
by Jason
05:01
created

OrderHistoryPageController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
dl 0
loc 32
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A checkMember() 0 8 2
A Index() 0 5 1
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