DocWrapper::__toString()   A
last analyzed

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
/**
4
 * This software package is licensed under `AGPL, Commercial` license[s].
5
 *
6
 * @package maslosoft/zamm
7
 * @license AGPL, Commercial
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/zamm/
11
 */
12
13
namespace Maslosoft\Zamm\Helpers;
14
15
use Parsedown;
16
17
/**
18
 * This will render markdown to html if requsted
19
 *
20
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
21
 */
22
class DocWrapper extends Wrapper
23
{
24
25
	public function __toString()
26
	{
27
28
		// Do not call parent
29
		if ($this->isHtml)
30
		{
31
			return (new Parsedown)->text($this->text);
32
		}
33
		return $this->text;
34
	}
35
36
}
37