Completed
Push — master ( 559d2f...0490e0 )
by Kevin
03:29
created

Canvas::getAllowedAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Tokens\Attribute;
6
use Groundskeeper\Tokens\ElementTypes\EmbeddedContent;
7
use Groundskeeper\Tokens\ElementTypes\FlowContent;
8
use Groundskeeper\Tokens\ElementTypes\OpenElement;
9
use Groundskeeper\Tokens\ElementTypes\PhrasingContent;
10
11
/**
12
 * "canvas" element
13
 *
14
 * https://html.spec.whatwg.org/multipage/semantics.html#the-canvas-element
15
 */
16 View Code Duplication
class Canvas extends OpenElement implements FlowContent, PhrasingContent, EmbeddedContent
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...
17
{
18 1
    protected function getAllowedAttributes()
19
    {
20
        $canvasAllowedAttributes = array(
21 1
            '/^width$/i' => Attribute::INT,
22
            '/^height$/i' => Attribute::INT
23 1
        );
24
25 1
        return array_merge(
26 1
            $canvasAllowedAttributes,
27 1
            parent::getAllowedAttributes()
28 1
        );
29
    }
30
}
31