Completed
Push — master ( 2c6b7a...b6434d )
by smiley
02:27
created

DBBaseModule::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 8
rs 9.4285
cc 3
eloc 4
nc 2
nop 1
1
<?php
2
/**
3
 * Class DBBaseModule
4
 *
5
 * @filesource   DBBaseModule.php
6
 * @created      28.02.2016
7
 * @package      chillerlan\bbcode\Modules\DB
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2016 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\bbcode\Modules\DB;
14
15
use chillerlan\bbcode\BBTemp;
16
use chillerlan\bbcode\Modules\Html5\{Html5BaseModule, Code, Containers, Expanders, Images, Links, Lists,
17
	Noparse, Simpletext, Singletags, StyledText, Tables, Video};
18
use chillerlan\Database\DBOptions;
19
use chillerlan\Database\Traits\DatabaseTrait;
20
21
/**
22
 *
23
 */
24
class DBBaseModule extends Html5BaseModule{
25
	use DatabaseTrait;
26
27
	/**
28
	 * Holds an array of FQN strings to the current base module's children
29
	 *
30
	 * @var array
31
	 * @see \chillerlan\bbcode\Modules\ModuleInfo::$modules
32
	 */
33
	protected $modules = [
34
		DBTags::class,
35
		Code::class,
36
		Containers::class,
37
		Expanders::class,
38
#		Images::class,
0 ignored issues
show
Unused Code Comprehensibility introduced by
37% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
39
#		Links::class,
40
		Lists::class,
41
		Noparse::class,
42
#		Simpletext::class,
0 ignored issues
show
Unused Code Comprehensibility introduced by
36% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
43
#		Singletags::class,
44
#		StyledText::class,
45
		Tables::class,
46
		Video::class,
47
	];
48
49
	/**
50
	 * @var \chillerlan\Database\Drivers\DBDriverInterface
51
	 */
52
	protected $DBDriverInterface;
53
54
	/**
55
	 * DBBaseModule constructor.
56
	 *
57
	 * @param \chillerlan\bbcode\BBTemp|null $bbtemp
58
	 */
59
	public function __construct(BBTemp $bbtemp = null){
60
		parent::__construct($bbtemp);
61
62
		if($this->parserOptions && $this->parserOptions->DBDriver){
63
			$this->DBDriverInterface = $this->dbconnect($this->parserOptions->DBDriver, $this->parserOptions->DBOptions);
64
		}
65
66
	}
67
68
}
69