Completed
Push — master ( cecf55...cf79c6 )
by Josh
10:46
created

Unformatted   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 10
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderRichText() 0 4 1
1
<?php
2
3
/**
4
* @package   s9e\TextFormatter
5
* @copyright Copyright (c) 2010-2017 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\TextFormatter\Renderers;
9
10
use s9e\TextFormatter\Renderer;
11
12
/**
13
* This renderer returns a plain text version of rich text. It is meant to be used as a last resort
14
* when every other renderer is unavailable
15
*/
16
class Unformatted extends Renderer
17
{
18
	/**
19
	* {@inheritdoc}
20
	*/
21 4
	protected function renderRichText($xml)
22
	{
23 4
		return str_replace("\n", "<br>\n", htmlspecialchars(strip_tags($xml), ENT_COMPAT, 'UTF-8', false));
24
	}
25
}