Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6.1384 |
Changes | 0 |
1 | <?php |
||
61 | 2 | public function addAnnotation( |
|
62 | DIProperty $property, SemanticData $semanticData |
||
63 | ) { |
||
64 | 2 | if ( $this->approvedStatus === null && class_exists( 'ApprovedRevs' ) ) { |
|
65 | $logReader = $this->appFactory->newDatabaseLogReader( |
||
66 | $semanticData->getSubject()->getTitle(), 'approval' |
||
67 | ); |
||
68 | $this->approvedStatus = $logReader->getStatus(); |
||
69 | } |
||
70 | |||
71 | 2 | if ( is_string( $this->approvedStatus ) && $this->approvedStatus !== "" ) { |
|
72 | 1 | $semanticData->addPropertyObjectValue( |
|
73 | 1 | $property, new DIString( $this->approvedStatus ) |
|
74 | 1 | ); |
|
75 | 1 | } else { |
|
76 | 1 | $semanticData->removeProperty( $property ); |
|
77 | } |
||
78 | 2 | } |
|
79 | } |
||
80 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..