Conditions | 8 |
Paths | 10 |
Total Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 10.9144 |
Changes | 0 |
1 | <?php |
||
63 | 2 | public function addAnnotation( DIProperty $property, SemanticData $semanticData ) { |
|
64 | |||
65 | if ( $this->approvedStatus === null && class_exists( 'ApprovedRevs' ) ) { |
||
66 | $title = $semanticData->getSubject()->getTitle(); |
||
67 | if ( ApprovedRevs::pageIsApprovable( $title ) ) { |
||
68 | $revId = ApprovedRevs::getApprovedRevID( $title ); |
||
69 | if ( $revId ) { |
||
70 | if ( $title->getLatestRevID( Title::GAID_FOR_UPDATE ) === $revId ) { |
||
71 | $this->approvedStatus = "approved"; |
||
72 | 2 | } else { |
|
73 | 1 | $this->approvedStatus = "pending"; |
|
74 | 1 | } |
|
75 | 1 | } else { |
|
76 | 1 | $this->approvedStatus = "unapproved"; |
|
77 | 1 | } |
|
78 | 1 | } |
|
79 | } |
||
80 | 2 | ||
81 | if ( is_string( $this->approvedStatus ) && $this->approvedStatus !== '' ) { |
||
82 | $semanticData->addPropertyObjectValue( |
||
83 | $property, |
||
84 | new DIString( $this->approvedStatus ) |
||
85 | ); |
||
86 | } else { |
||
87 | $semanticData->removeProperty( $property ); |
||
88 | } |
||
89 | } |
||
90 | |||
92 |
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..