Test Failed
Pull Request — dev (#1)
by Paweł
02:00
created

Script   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A new() 0 3 1
A __construct() 0 3 1
A show() 0 3 1
1
<?php
2
3
namespace pjpawel\Magis\Helper;
4
5
/**
6
 * @author Paweł Podgórski <[email protected]>
7
 */
8
class Script extends AbstractComponent
9
{
10
11
    private string $script;
12
13
    public function __construct(string $script)
14
    {
15
        $this->script = $script;
16
    }
17
18
    public function show(): string
19
    {
20
        return '<script>' . $this->script . '</script>';
21
    }
22
23
    public static function new(string $script): self
24
    {
25
        return new self($script);
26
    }
27
}