Conditions | 5 |
Paths | 6 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | 'token' => $this->api->getToken(), |
||
26 | ]; |
||
27 | |||
28 | if ( $file->getPageIdentifier()->getTitle() !== null ) { |
||
29 | $params['titles'] = $file->getPageIdentifier()->getTitle()->getText(); |
||
30 | } else { |
||
31 | $params['pageids'] = $file->getPageIdentifier()->getId(); |
||
32 | } |
||
33 | |||
34 | $result = $this->api->postRequest( new SimpleRequest( 'imagerotate', $params ) ); |
||
35 | |||
36 | // This module sometimes gives odd errors so deal with them.. |
||
37 | if ( array_key_exists( 'imagerotate', $result ) ) { |
||
38 | $imageRotate = array_pop( $result['imagerotate'] ); |
||
39 | if ( array_key_exists( 'result', $imageRotate ) && |
||
40 | $imageRotate['result'] == 'Failure' |
||
41 | ) { |
||
42 | throw new UsageException( |
||
43 | 'imagerotate-Failure', |
||
44 | $imageRotate['errormessage'], |
||
45 | $result |
||
46 | ); |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return true; |
||
51 | } |
||
52 | |||
53 | } |
||
54 |