BorderCollapse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 9 3
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * BorderCollapse 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 BorderCollapse.
18
 */
19
class BorderCollapse extends Normalizer
20
{
21
	public function normalize($ruleValue, string $ruleName = ''): array
22
	{
23
		if (null === $this->normalized) {
24
			if (!\in_array($ruleValue, ['collapse', 'separate', 'inherit'])) {
25
				$ruleValue = 'separate';
26
			}
27
			return $this->normalized = ['border-collapse' => $ruleValue];
28
		}
29
		return $this->normalized;
30
	}
31
}
32