Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.9102 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
75 | 2 | public function addAnnotation( |
|
76 | DIProperty $property, SemanticData $semanticData |
||
77 | ) { |
||
78 | 2 | if ( $this->approvedDate === null && class_exists( 'ApprovedRevs' ) ) { |
|
79 | $logReader = $this->appFactory->newDatabaseLogReader( |
||
80 | $semanticData->getSubject()->getTitle(), 'approval' |
||
81 | ); |
||
82 | $this->approvedDate = $logReader->getDateOfLogEntry(); |
||
83 | } |
||
84 | |||
85 | 2 | $dataItem = $this->getDataItem(); |
|
86 | 2 | if ( $dataItem ) { |
|
87 | 1 | $semanticData->addPropertyObjectValue( $property, $dataItem ); |
|
88 | 1 | } else { |
|
89 | 1 | $semanticData->removeProperty( $property ); |
|
90 | } |
||
91 | 2 | } |
|
92 | } |
||
93 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: