Passed
Push — master ( 2afdeb...b846a2 )
by Nikolaos
06:23 queued 03:51
created

Script   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 28
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTag() 0 3 1
A getAttributes() 0 10 1
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * For the full copyright and license information, please view the LICENSE.md
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Phalcon\Html\Helper;
13
14
/**
15
 * Class Script
16
 */
17
class Script extends Style
18
{
19
    /**
20
     * @return string
21
     */
22 1
    protected function getTag(): string
23
    {
24 1
        return 'script';
25
    }
26
27
    /**
28
     * Returns the necessary attributes
29
     *
30
     * @param string $src
31
     * @param array  $attributes
32
     *
33
     * @return array
34
     */
35 1
    protected function getAttributes(string $src, array $attributes): array
36
    {
37
        $required = [
38 1
            'src'  => $src,
39 1
            'type' => 'text/javascript',
40
        ];
41
42 1
        unset($attributes["src"]);
43
44 1
        return array_merge($required, $attributes);
45
    }
46
}
47