Completed
Push — master ( a17ead...35004c )
by Kevin
02:36
created

Main   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 4
c 2
b 0
f 2
lcom 1
cbo 4
dl 0
loc 18
ccs 0
cts 14
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A doClean() 0 15 4
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\ElementTypes\FlowContent;
6
use Groundskeeper\Tokens\ElementTypes\OpenElement;
7
use Psr\Log\LoggerInterface;
8
9
/**
10
 * "main" element
11
 */
12
class Main extends OpenElement implements FlowContent
13
{
14
    protected function doClean(LoggerInterface $logger)
15
    {
16
        $footer = new Footer($this->configuration, 'footer');
17
        $header = new Header($this->configuration, 'header');
18
        $main = new Main($this->configuration, 'main');
19
        if ($this->hasAncestor($footer) ||
20
            $this->hasAncestor($header) ||
21
            $this->hasAncestor($main)) {
22
            $logger->debug('Removing ' . $this . '. Element "main" should not be a descendant of "footer", "header", or "main" elements.');
23
24
            return false;
25
        }
26
27
        return true;
28
    }
29
}
30