Passed
Branch master (acb862)
by Simon
03:16
created

HaveIBeenPwnedPage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getControllerName() 0 3 1
A canCreate() 0 8 2
1
<?php
2
3
namespace Firesphere\HaveIBeenPwned\Models;
4
5
use Firesphere\HaveIBeenPwned\Controllers\HaveIBeenPwnedPageController;
6
use Page;
7
8
/**
9
 * Class \Firesphere\HaveIBeenPwned\Models\HaveIBeenPwnedPage
10
 *
11
 */
12
class HaveIBeenPwnedPage extends Page
13
{
14
    private static $table_name = 'HaveIBeenPwnedPage';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
15
16
    /**
17
     * Get the controller name for this page
18
     *
19
     * @return string
20
     */
21
    public function getControllerName()
22
    {
23
        return HaveIBeenPwnedPageController::class;
24
    }
25
26
    public function canCreate($member = null, $context = array())
27
    {
28
        // This page should only exist once
29
        if (static::get()->count()) {
30
            return false;
31
        }
32
33
        return parent::canCreate($member, $context);
34
    }
35
}
36