SanitizerAbstract   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
/**
3
 * Class SanitizerAbstract
4
 *
5
 * @filesource   SanitizerAbstract.php
6
 * @created      19.04.2018
7
 * @package      chillerlan\BBCode
8
 * @author       smiley <[email protected]>
9
 * @copyright    2018 smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\BBCode;
14
15
use chillerlan\Settings\SettingsContainerInterface;
16
17
abstract class SanitizerAbstract implements SanitizerInterface{
18
19
	/**
20
	 * @var \chillerlan\BBCode\BBCodeOptions
21
	 */
22
	protected $options;
23
24
	/**
25
	 * SanitizerInterface constructor.
26
	 *
27
	 * @param \chillerlan\Settings\SettingsContainerInterface $options
28
	 */
29
	public function __construct(SettingsContainerInterface $options){
30
		$this->options = $options;
0 ignored issues
show
Documentation Bug introduced by
$options is of type object<chillerlan\Settin...ingsContainerInterface>, but the property $options was declared to be of type object<chillerlan\BBCode\BBCodeOptions>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
31
	}
32
33
}
34