Completed
Push — master ( 9fbe45...817727 )
by Kevin
03:24
created

Figcaption::doClean()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 14
loc 14
ccs 0
cts 11
cp 0
rs 9.2
cc 4
eloc 8
nc 2
nop 1
crap 20
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\ElementTypes\FlowContent;
6
use Groundskeeper\Tokens\ElementTypes\OpenElement;
7
use Groundskeeper\Tokens\ElementTypes\SectioningRoot;
8
use Psr\Log\LoggerInterface;
9
10
/**
11
 * "figcaption" element
12
 *
13
 * https://html.spec.whatwg.org/multipage/semantics.html#the-figcaption-element
14
 */
15 View Code Duplication
class Figcaption extends OpenElement implements FlowContent, SectioningRoot
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    protected function removeInvalidSelf(LoggerInterface $logger)
18
    {
19
        // Must be child of "figure" element.
20
        $parent = $this->getParent();
21
        if ($parent !== null && $parent->getName() != 'figure') {
22
            $logger->debug($this . ' must be a child of a "figure" element.');
23
24
            return true;
25
        }
26
27
        return false;
28
    }
29
}
30