Completed
Pull Request — 2.x (#41)
by jake
02:03
created

StructureRaw   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 2
1
<?php
2
/**
3
 *
4
 * This file is part of Aura for PHP.
5
 *
6
 * @license http://opensource.org/licenses/bsd-license.php BSD
7
 *
8
 */
9
namespace Aura\Html\Helper;
10
11
/**
12
 *
13
 * Helper to generate a snippet of nested HTML.
14
 *
15
 * @package Aura.Html
16
 *
17
 */
18
class StructureRaw extends AbstractElement
19
{
20
    /**
21
     *
22
     * Returns any kind of nestd HTML elements with attributes.
23
     *
24
     * @param string $tag The tag to generate.
25
     *
26
     * @param string|array $content The element content
27
     *
28
     * @param array $attr Attributes for the tag.
29
     *
30
     * @return string
31
     *
32
     */
33 2
    public function __invoke($tag, $content, array $attr = array())
34
    {
35 2
        if (is_array($content)) {
36 2
            $content = call_user_func_array($this, $content);
37 2
        }
38
39 2
        return $this->raw($tag, $content, $attr);
40
    }
41
}
42