| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare( strict_types=1 ); |
||
| 12 | public function runInternal() : int { |
||
| 13 | $pages = $this->getDataProvider()->getCreatedPages(); |
||
| 14 | $users = $this->getDataProvider()->getUsersToProcess(); |
||
| 15 | |||
| 16 | if ( !$pages || !$users ) { |
||
|
1 ignored issue
–
show
|
|||
| 17 | return self::STATUS_NOTHING; |
||
| 18 | } |
||
| 19 | |||
| 20 | $ricNums = []; |
||
| 21 | foreach ( $pages as $page ) { |
||
| 22 | $ricNums[ $page->getUser() ] = $page->getNum(); |
||
| 23 | } |
||
| 24 | |||
| 25 | foreach ( $users as $user => $_ ) { |
||
| 26 | $this->addMsg( $user, $ricNums[ $user ] ); |
||
| 27 | } |
||
| 28 | |||
| 29 | return self::STATUS_GOOD; |
||
| 30 | } |
||
| 53 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.