Total Complexity | 5 |
Total Lines | 69 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | final class SimpleShortcode implements Contracts\AttributeInterface, Contracts\AliasInterface, Contracts\ContainerAwareInterface |
||
14 | { |
||
15 | use Traits\Attribute; |
||
16 | use Traits\Alias; |
||
17 | use Traits\ContainerAware; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $name; |
||
23 | |||
24 | /** |
||
25 | * @var mixed[] |
||
26 | */ |
||
27 | protected $attributes; |
||
28 | |||
29 | /** |
||
30 | * @var string[] |
||
31 | */ |
||
32 | protected $alias = []; |
||
33 | |||
34 | /** |
||
35 | * @var Closure|null |
||
36 | */ |
||
37 | protected $callback; |
||
38 | |||
39 | /** |
||
40 | * @param string $name |
||
41 | * @param mixed[]|null $atts |
||
42 | * @param Closure|null $callback |
||
43 | */ |
||
44 | 10 | public function __construct($name, $atts = [], Closure $callback = null) |
|
45 | { |
||
46 | 10 | $this->name = $name; |
|
47 | 10 | $this->attributes = (array) $atts; |
|
48 | 10 | $this->callback = $callback; |
|
49 | 10 | } |
|
50 | |||
51 | /** |
||
52 | * @param string|null $content |
||
53 | * @param mixed[] $atts |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | 2 | public function handle(?string $content = null, array $atts = []): string |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param string $alias |
||
69 | * |
||
70 | * @throws RegisterException |
||
71 | * |
||
72 | * @return Contracts\AliasInterface |
||
73 | */ |
||
74 | 1 | public function alias(string $alias): Contracts\AliasInterface |
|
82 | } |
||
83 | } |
||
84 |