| Conditions | 3 |
| Paths | 3 |
| Total Lines | 36 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function getLogList( array $extraParams = [] ) { |
||
| 26 | $logList = new LogList(); |
||
| 27 | |||
| 28 | while ( true ) { |
||
| 29 | $params = [ |
||
| 30 | 'list' => 'logevents', |
||
| 31 | 'leprop' => 'title|ids|type|user|timestamp|comment|details' |
||
| 32 | ]; |
||
| 33 | |||
| 34 | $newParams = array_merge( $extraParams, $params ); |
||
| 35 | $result = $this->api->getRequest( new SimpleRequest( 'query', $newParams ) ); |
||
| 36 | |||
| 37 | foreach ( $result[ 'query' ]['logevents'] as $logevent ) { |
||
| 38 | $logList->addLog( |
||
| 39 | new Log( |
||
| 40 | $logevent['logid'], |
||
| 41 | $logevent['type'], |
||
| 42 | $logevent['action'], |
||
| 43 | $logevent['timestamp'], |
||
| 44 | $logevent['user'], |
||
| 45 | new Page( |
||
|
|
|||
| 46 | new PageIdentifier( |
||
| 47 | new Title( $logevent['title'], $logevent['ns'] ), |
||
| 48 | $logevent['pageid'] |
||
| 49 | ), |
||
| 50 | new Revisions() |
||
| 51 | ), |
||
| 52 | $logevent['comment'], |
||
| 53 | $this->getLogDetailsFromEvent( $logevent ) |
||
| 54 | ) |
||
| 55 | ); |
||
| 56 | } |
||
| 57 | |||
| 58 | return $logList; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 84 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: