dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Use getFileContents() instead of incorrect file system call to fetch file...
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiImageRotate.php
diff --git
a/includes/api/ApiImageRotate.php
b/includes/api/ApiImageRotate.php
index
ebdbedd
..
7a60e83
100644
(file)
--- a/
includes/api/ApiImageRotate.php
+++ b/
includes/api/ApiImageRotate.php
@@
-22,7
+22,6
@@
*/
class ApiImageRotate extends ApiBase {
*/
class ApiImageRotate extends ApiBase {
-
private $mPageSet = null;
public function __construct( $main, $action ) {
private $mPageSet = null;
public function __construct( $main, $action ) {
@@
-38,31
+37,28
@@
class ApiImageRotate extends ApiBase {
*/
private static function addValues( array &$result, $values, $flag = null, $name = null ) {
foreach ( $values as $val ) {
*/
private static function addValues( array &$result, $values, $flag = null, $name = null ) {
foreach ( $values as $val ) {
- if( $val instanceof Title ) {
+ if
( $val instanceof Title ) {
$v = array();
ApiQueryBase::addTitleInfo( $v, $val );
$v = array();
ApiQueryBase::addTitleInfo( $v, $val );
- } elseif( $name !== null ) {
+ } elseif
( $name !== null ) {
$v = array( $name => $val );
} else {
$v = $val;
}
$v = array( $name => $val );
} else {
$v = $val;
}
- if( $flag !== null ) {
+ if
( $flag !== null ) {
$v[$flag] = '';
}
$result[] = $v;
}
}
$v[$flag] = '';
}
$result[] = $v;
}
}
-
public function execute() {
$params = $this->extractRequestParams();
$rotation = $params['rotation'];
public function execute() {
$params = $this->extractRequestParams();
$rotation = $params['rotation'];
- $user = $this->getUser();
$pageSet = $this->getPageSet();
$pageSet->execute();
$pageSet = $this->getPageSet();
$pageSet->execute();
- $result = array();
$result = array();
self::addValues( $result, $pageSet->getInvalidTitles(), 'invalid', 'title' );
$result = array();
self::addValues( $result, $pageSet->getInvalidTitles(), 'invalid', 'title' );
@@
-154,7
+150,8
@@
class ApiImageRotate extends ApiBase {
/**
* Checks that the user has permissions to perform rotations.
/**
* Checks that the user has permissions to perform rotations.
- * @param $user User The user to check.
+ * @param User $user The user to check
+ * @param Title $title
* @return string|null Permission error message, or null if there is no error
*/
protected function checkPermissions( $user, $title ) {
* @return string|null Permission error message, or null if there is no error
*/
protected function checkPermissions( $user, $title ) {
@@
-181,7
+178,6
@@
class ApiImageRotate extends ApiBase {
}
public function getAllowedParams( $flags = 0 ) {
}
public function getAllowedParams( $flags = 0 ) {
- $pageSet = $this->getPageSet();
$result = array(
'rotation' => array(
ApiBase::PARAM_TYPE => array( '90', '180', '270' ),
$result = array(
'rotation' => array(
ApiBase::PARAM_TYPE => array( '90', '180', '270' ),
@@
-200,7
+196,7
@@
class ApiImageRotate extends ApiBase {
public function getParamDescription() {
$pageSet = $this->getPageSet();
public function getParamDescription() {
$pageSet = $this->getPageSet();
- return $pageSet->getParamDescription() + array(
+ return $pageSet->get
Final
ParamDescription() + array(
'rotation' => 'Degrees to rotate image clockwise',
'token' => 'Edit token. You can get one of these through action=tokens',
);
'rotation' => 'Degrees to rotate image clockwise',
'token' => 'Edit token. You can get one of these through action=tokens',
);
@@
-222,7
+218,7
@@
class ApiImageRotate extends ApiBase {
$pageSet = $this->getPageSet();
return array_merge(
parent::getPossibleErrors(),
$pageSet = $this->getPageSet();
return array_merge(
parent::getPossibleErrors(),
- $pageSet->getPossibleErrors()
+ $pageSet->get
Final
PossibleErrors()
);
}
);
}