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

DocWrapper::__toString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
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