Code Duplication    Length = 11-12 lines in 2 locations

Page.php 1 location

@@ 16-27 (lines=12) @@
13
        \add_action('admin_menu', array($this,'add_menu_page'));
14
    }
15
    
16
    public function add_menu_page()
17
    {
18
        \add_menu_page(
19
            $this->config['title'], 
20
            $this->config['menu_title'], 
21
            $this->config['capability'], 
22
            $this->config['slug'], 
23
            null, // Create a child page with the parent_slug set to this page's slug
24
            $this->config['icon'],
25
            $this->config['position']
26
        );
27
    }
28
    
29
    private function default_args()
30
    {

ChildPage.php 1 location

@@ 45-55 (lines=11) @@
42
    /**
43
     * Internally used to add a submenu page for this child page
44
     */
45
    public function add_submenu_page()
46
    {
47
        \add_submenu_page(
48
            $this->config['parent_slug'], 
49
            $this->config['title'], 
50
            $this->config['menu_title'], 
51
            $this->config['capability'],
52
            $this->config['slug'],
53
            array($this, 'render')
54
        );
55
    }
56
    
57
    /**
58
     * Conditionally enqueue settings scripts and styles if the calling page is