| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.054 |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | 2 | public function addAnnotation( SemanticData $semanticData ) { |
|
| 59 | |||
| 60 | 2 | if ( $this->approvedRev === null ) { |
|
| 61 | $this->approvedRev = $this->approvedRevsFacade->getApprovedRevID( |
||
| 62 | $semanticData->getSubject()->getTitle() |
||
|
|
|||
| 63 | ); |
||
| 64 | } |
||
| 65 | |||
| 66 | 2 | $property = $this->newDIProperty(); |
|
| 67 | 2 | $semanticData->removeProperty( $property ); |
|
| 68 | |||
| 69 | 2 | if ( is_numeric( $this->approvedRev ) ) { |
|
| 70 | 1 | $semanticData->addPropertyObjectValue( |
|
| 71 | 1 | $property, |
|
| 72 | 1 | $this->newDINumber() |
|
| 73 | ); |
||
| 74 | } |
||
| 75 | 2 | } |
|
| 76 | |||
| 82 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: