Merge "EditPage::newSectionSummary should return a value in all code paths"
[lhc/web/wiklou.git] / includes / api / ApiImageRotate.php
index b8e16ab..26def44 100644 (file)
@@ -26,10 +26,10 @@ class ApiImageRotate extends ApiBase {
 
        /**
         * Add all items from $values into the result
-        * @param array $result output
-        * @param array $values values to add
-        * @param string $flag the name of the boolean flag to mark this element
-        * @param string $name if given, name of the value
+        * @param array $result Output
+        * @param array $values Values to add
+        * @param string $flag The name of the boolean flag to mark this element
+        * @param string $name If given, name of the value
         */
        private static function addValues( array &$result, $values, $flag = null, $name = null ) {
                foreach ( $values as $val ) {
@@ -52,6 +52,8 @@ class ApiImageRotate extends ApiBase {
                $params = $this->extractRequestParams();
                $rotation = $params['rotation'];
 
+               $this->getResult()->beginContinuation( $params['continue'], array(), array() );
+
                $pageSet = $this->getPageSet();
                $pageSet->execute();
 
@@ -131,6 +133,7 @@ class ApiImageRotate extends ApiBase {
                $apiResult = $this->getResult();
                $apiResult->setIndexedTagName( $result, 'page' );
                $apiResult->addValue( null, $this->getModuleName(), $result );
+               $apiResult->endContinuation();
        }
 
        /**
@@ -185,6 +188,7 @@ class ApiImageRotate extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true
                        ),
+                       'continue' => '',
                );
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
@@ -199,6 +203,7 @@ class ApiImageRotate extends ApiBase {
                return $pageSet->getFinalParamDescription() + array(
                        'rotation' => 'Degrees to rotate image clockwise',
                        'token' => 'Edit token. You can get one of these through action=tokens',
+                       'continue' => 'When more results are available, use this to continue',
                );
        }
 
@@ -214,15 +219,6 @@ class ApiImageRotate extends ApiBase {
                return '';
        }
 
-       public function getPossibleErrors() {
-               $pageSet = $this->getPageSet();
-
-               return array_merge(
-                       parent::getPossibleErrors(),
-                       $pageSet->getFinalPossibleErrors()
-               );
-       }
-
        public function getExamples() {
                return array(
                        'api.php?action=imagerotate&titles=Example.jpg&rotation=90&token=123ABC',