Completed
Push — master ( 9391c4...3be88f )
by Peter
04:35
created

DocWrapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 10 2
1
<?php
2
3
namespace Maslosoft\Zamm\Helpers;
4
5
use Parsedown;
6
7
/**
8
 * This will render markdown to html if requsted
9
 *
10
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
11
 */
12
class DocWrapper extends Wrapper
13
{
14
15
	public function __toString()
16
	{
17
18
		// Do not call parent
19
		if ($this->isHtml)
20
		{
21
			return (new Parsedown)->text($this->text);
22
		}
23
		return $this->text;
24
	}
25
26
}
27