Test Failed
Push — develop ( ff58ad...b8f9b2 )
by steve
13:44 queued 12s
created

HtmlPurifier   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 7
dl 0
loc 15
rs 10
c 2
b 0
f 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
1
<?php
2
3
namespace neon\core\helpers;
4
5
use HTMLPurifier_Config;
6
use yii\helpers\BaseHtmlPurifier;
7
8
class HtmlPurifier extends BaseHtmlPurifier
9
{
10
	/**
11
	 * Extend config for processing
12
	 *
13
	 * @param HTMLPurifier_Config $config
14
	 */
15
	protected static function configure($config)
16
	{
17
		parent::configure($config);
18
		$def = $config->getHTMLDefinition(true);
19
		$def->addAttribute('a', 'target', 'Text');
20
		$def->addAttribute('img', 'srcset', 'Text');
21
		$def->addAttribute('img', 'sizes', 'Text');
22
		$def->addAttribute('img', 'loading', 'Text');
23
	}
24
}