| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | public function addAnnotation( DIProperty $property, SemanticData $semanticData ) { |
||
| 53 | |||
| 54 | $title = $semanticData->getSubject()->getTitle(); |
||
| 55 | $page = $this->appFactory->newWikiPage( $title ); |
||
|
|
|||
| 56 | |||
| 57 | $user = $this->appFactory->newUserFromID( $page->getUser() ); |
||
| 58 | $authors = $page->getContributors(); |
||
| 59 | |||
| 60 | $dataItem = null; |
||
| 61 | |||
| 62 | while ( $user ) { |
||
| 63 | //no anonymous users (hidden users are not returned) |
||
| 64 | if ( $this->isNotAnonymous( $user ) ) { |
||
| 65 | $semanticData->addPropertyObjectValue( |
||
| 66 | $property, |
||
| 67 | DIWikiPage::newFromTitle( $user->getUserPage() ) |
||
| 68 | ); |
||
| 69 | } |
||
| 70 | |||
| 71 | $user = $authors->current(); |
||
| 72 | $authors->next(); |
||
| 73 | } |
||
| 74 | } |
||
| 75 | |||
| 81 |
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: