Merge "fixed php doc in ApiBase"
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index ee6f2c0..f386a8a 100644 (file)
@@ -445,7 +445,7 @@ abstract class ApiBase extends ContextSource {
                                                                $hintPipeSeparated = false;
                                                                break;
                                                        case 'limit':
-                                                               $desc .= $paramPrefix . "No more than {$paramSettings[self :: PARAM_MAX]}";
+                                                               $desc .= $paramPrefix . "No more than {$paramSettings[self::PARAM_MAX]}";
                                                                if ( isset( $paramSettings[self::PARAM_MAX2] ) ) {
                                                                        $desc .= " ({$paramSettings[self::PARAM_MAX2]} for bots)";
                                                                }
@@ -822,7 +822,7 @@ abstract class ApiBase extends ContextSource {
         *      If not set will magically default to either watchdefault or watchcreations
         * @return bool
         */
-       protected function getWatchlistValue ( $watchlist, $titleObj, $userOption = null ) {
+       protected function getWatchlistValue( $watchlist, $titleObj, $userOption = null ) {
 
                $userWatching = $this->getUser()->isWatched( $titleObj );
 
@@ -1081,7 +1081,7 @@ abstract class ApiBase extends ContextSource {
 
                if ( !$allowMultiple && count( $valuesList ) != 1 ) {
                        // Bug 33482 - Allow entries with | in them for non-multiple values
-                       if ( in_array( $value, $allowedValues ) ) {
+                       if ( in_array( $value, $allowedValues, true ) ) {
                                return $value;
                        }
 
@@ -1165,7 +1165,7 @@ abstract class ApiBase extends ContextSource {
        /**
         * Validate and normalize of parameters of type 'user'
         * @param string $value Parameter value
-        * @param string $encParamName Parameter value
+        * @param string $encParamName Parameter name
         * @return string Validated and normalized parameter
         */
        private function validateUser( $value, $encParamName ) {
@@ -1535,7 +1535,7 @@ abstract class ApiBase extends ContextSource {
        public function getWatchlistUser( $params ) {
                if ( !is_null( $params['owner'] ) && !is_null( $params['token'] ) ) {
                        $user = User::newFromName( $params['owner'], false );
-                       if ( !($user && $user->getId()) ) {
+                       if ( !( $user && $user->getId() ) ) {
                                $this->dieUsage( 'Specified user does not exist', 'bad_wlowner' );
                        }
                        $token = $user->getOption( 'watchlisttoken' );
@@ -1568,7 +1568,7 @@ abstract class ApiBase extends ContextSource {
                $params = $this->getFinalParams();
                if ( $params ) {
                        foreach ( $params as $paramName => $paramSettings ) {
-                               if ( isset( $paramSettings[ApiBase::PARAM_REQUIRED] ) ) {
+                               if ( isset( $paramSettings[ApiBase::PARAM_REQUIRED] ) && $paramSettings[ApiBase::PARAM_REQUIRED] ) {
                                        $ret[] = array( 'missingparam', $paramName );
                                }
                        }