MarginLeft::normalize()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 10
rs 10
cc 3
nc 3
nop 2
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * MarginLeft class.
6
 *
7
 * @package   YetiForcePDF\Style\Normalizer
8
 *
9
 * @copyright YetiForce Sp. z o.o
10
 * @license   MIT
11
 * @author    Rafal Pospiech <[email protected]>
12
 */
13
14
namespace YetiForcePDF\Style\Normalizer;
15
16
/**
17
 * Class MarginLeft.
18
 */
19
class MarginLeft extends Normalizer
20
{
21
	public function normalize($ruleValue, string $ruleName = ''): array
22
	{
23
		if (null === $this->normalized) {
24
			$css = [];
25
			if ($number = $this->getNumberValues($ruleValue)) {
26
				$css = ['margin-left' => $number[0]];
27
			}
28
			$this->normalized = $css;
29
		}
30
		return $this->normalized;
31
	}
32
}
33