Completed
Push — master ( 8f4937...fedf49 )
by smiley
03:03
created

MyAwesomeBaseModule   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 32
rs 10
1
<?php
2
/**
3
 * Class MyAwesomeBaseModule
4
 *
5
 * @filesource   MyAwesomeBaseModule.php
6
 * @created      02.11.2015
7
 * @package      Example\MyModules
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2015 Smiley
10
 * @license      MIT
11
 */
12
13
namespace Example\MyModules;
14
15
use chillerlan\bbcode\Modules\BaseModule;
16
use chillerlan\bbcode\Modules\BaseModuleInterface;
17
18
/**
19
 * The base module implements the basic functionality for each module (custom HTML5)
20
 */
21
class MyAwesomeBaseModule extends BaseModule implements BaseModuleInterface{
22
23
	/**
24
	 * Holds an array of FQN strings to the current base module's children
25
	 *
26
	 * @var array
27
	 * @see \chillerlan\bbcode\Modules\ModuleInfo::$modules
28
	 */
29
	protected $modules = [
30
		'\\Example\\MyModules\\MyAwesomeModule',
31
	];
32
33
	/**
34
	 * Holds the current base module's EOL token which will replace any newlines
35
	 *
36
	 * @var string
37
	 * @see \chillerlan\bbcode\Modules\ModuleInfo::$eol_token
38
	 */
39
	protected $eol_token = '<br />';
40
41
	/**
42
	 * Sanitizes the content to prevent vulnerabilities or compatibility problems
43
	 *
44
	 * @param $content string to sanitize
45
	 *
46
	 * @return string
47
	 */
48
	public function sanitize($content){
49
		return htmlspecialchars($content, ENT_NOQUOTES|ENT_HTML5, 'UTF-8', false);
50
	}
51
52
}
53