Completed
Branch EDTR/master (6bd139)
by
unknown
35:03 queued 26:41
created

EspressoEventsAdmin   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 6
lcom 2
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A matchesCurrentRequest() 0 8 4
A registerDependencies() 0 7 1
A requestHandler() 0 4 1
1
<?php
2
3
namespace EventEspresso\core\domain\entities\routing\handlers\admin;
4
5
use EE_Dependency_Map;
6
7
/**
8
 * Class EspressoEventsAdmin
9
 * detects and executes logic for any Event Espresso Events admin page
10
 *
11
 * @package EventEspresso\core\domain\entities\routing\admin
12
 * @author  Brent Christensen
13
 * @since   $VID:$
14
 */
15
class EspressoEventsAdmin extends AdminRoute
16
{
17
18
    /**
19
     * returns true if the current request matches this route
20
     *
21
     * @return bool
22
     * @since   $VID:$
23
     */
24
    public function matchesCurrentRequest()
25
    {
26
        global $pagenow;
27
        return $pagenow
28
               && $pagenow === 'admin.php'
29
               && $this->request->isAdmin()
30
               && $this->request->getRequestParam('page') === 'espresso_events';
31
    }
32
33
34
    /**
35
     * @since $VID:$
36
     */
37
    protected function registerDependencies()
38
    {
39
        $this->dependency_map->registerDependencies(
40
            'EventEspresso\core\domain\services\admin\events\default_settings\AdvancedEditorAdminFormSection',
41
            ['EE_Admin_Config' => EE_Dependency_Map::load_from_cache]
42
        );
43
    }
44
45
46
    /**
47
     * implements logic required to run during request
48
     *
49
     * @return bool
50
     * @since   $VID:$
51
     */
52
    protected function requestHandler()
53
    {
54
        return false;
55
    }
56
}
57