| Conditions | 5 |
| Paths | 4 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5.9256 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 61 | 2 | public function addAnnotation( DIProperty $property, SemanticData $semanticData ) { |
|
| 62 | |||
| 63 | 2 | if ( $this->approvedStatus === null && class_exists( 'ApprovedRevs' ) ) { |
|
| 64 | |||
| 65 | $logReader = $this->appFactory->newDatabaseLogReader( |
||
| 66 | $semanticData->getSubject()->getTitle(), 'approval' |
||
| 67 | ); |
||
| 68 | |||
| 69 | $this->approvedStatus = $logReader->getStatusOfLogEntry(); |
||
| 70 | } |
||
| 71 | |||
| 72 | 2 | if ( is_string( $this->approvedStatus ) && $this->approvedStatus !== '' ) { |
|
| 73 | 1 | $semanticData->addPropertyObjectValue( |
|
| 74 | 1 | $property, |
|
| 75 | 1 | new DIString( $this->approvedStatus ) |
|
| 76 | 1 | ); |
|
| 77 | 1 | } else { |
|
| 78 | 1 | $semanticData->removeProperty( $property ); |
|
| 79 | } |
||
| 80 | 2 | } |
|
| 81 | |||
| 83 |
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..