Completed
Push — main ( bb2763...a8dc43 )
by Peter
26s queued 13s
created

Css::toStyles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Html\Helper;
6
7
class Css
8
{
9
    /**
10
     * @param array<string,string> $styles
11
     *
12
     * @return string
13
     */
14
    public static function toStyles(array $styles): string
15
    {
16
        $tmp = [];
17
        foreach ($styles as $k => $v) {
18
            $tmp[] = sprintf('%s: %s', $k, $v);
19
        }
20
21
        return implode('; ', $tmp);
22
    }
23
}
24