Completed
Push — master ( 01c28b...0d4f0a )
by Andreas
17:26
created

midgard_admin_asgard_handler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 15
ccs 6
cts 7
cp 0.8571
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_response() 0 10 3
1
<?php
2
/**
3
 * @package midgard.admin.asgard
4
 * @author CONTENT CONTROL http://www.contentcontrol-berlin.de/
5
 * @copyright CONTENT CONTROL http://www.contentcontrol-berlin.de/
6
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
7
 */
8
9
/**
10
 * Style helper
11
 *
12
 * @package midgard.admin.asgard
13
 */
14
trait midgard_admin_asgard_handler
15
{
16
    /**
17
     * @return midcom_response_styled
18
     */
19 40
    public function get_response($element = null) : midcom_response_styled
20
    {
21 40
        if (isset($_GET['ajax'])) {
22
            midcom::get()->skip_page_style = true;
23
        }
24 40
        $this->populate_breadcrumb_line();
0 ignored issues
show
Bug introduced by
It seems like populate_breadcrumb_line() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        $this->/** @scrutinizer ignore-call */ 
25
               populate_breadcrumb_line();
Loading history...
25 40
        if ($element) {
26 20
            return $this->show($element, 'ASGARD_ROOT');
0 ignored issues
show
Bug introduced by
It seems like show() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
            return $this->/** @scrutinizer ignore-call */ show($element, 'ASGARD_ROOT');
Loading history...
27
        }
28 20
        return new midcom_response_styled(midcom_core_context::get(), 'ASGARD_ROOT');
29
    }
30
}
31