Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/368041 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.1 ...................................................................... build: Updating mediawiki/mediawiki-codesniffer to 0.10.1 Change-Id: Ib920133c0b840c7e5729682231e155a3854d3982 --- M api/MWOAuthAPI.setup.php M api/MWOAuthSessionProvider.php M backend/MWOAuthConsumer.php M backend/MWOAuthDataStore.php M backend/MWOAuthUtils.php M composer.json M frontend/MWOAuthUI.hooks.php M phpcs.xml 8 files changed, 30 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth refs/changes/41/368041/1 diff --git a/api/MWOAuthAPI.setup.php b/api/MWOAuthAPI.setup.php index d71767c..a0007e4 100755 --- a/api/MWOAuthAPI.setup.php +++ b/api/MWOAuthAPI.setup.php @@ -11,7 +11,7 @@ /** * Prevent CentralAuth from issuing centralauthtokens if we have * OAuth headers in this request. - * @return boolean + * @return bool */ public static function onCentralAuthAbortCentralAuthToken() { $request = \RequestContext::getMain()->getRequest(); diff --git a/api/MWOAuthSessionProvider.php b/api/MWOAuthSessionProvider.php index 8f9ff11..4b16f2d 100644 --- a/api/MWOAuthSessionProvider.php +++ b/api/MWOAuthSessionProvider.php @@ -232,7 +232,7 @@ * @param \ApiBase $module * @param \User $user * @param string|array &$message - * @return boolean + * @return bool */ public function onApiCheckCanExecute( \ApiBase $module, \User $user, &$message ) { global $wgMWOauthDisabledApiModules; @@ -258,7 +258,7 @@ * Record the fact that OAuth was used for anything added to RecentChanges. * * @param \RecentChange $rc - * @return boolean true + * @return bool true */ public function onRecentChange_save( $rc ) { $data = $this->getSessionData( $rc->getPerformer() ?: null ); diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php index 976bdce..afc3e0d 100644 --- a/backend/MWOAuthConsumer.php +++ b/backend/MWOAuthConsumer.php @@ -91,11 +91,11 @@ * @var array */ public static $stageNames = [ - MWOAuthConsumer::STAGE_PROPOSED => 'proposed', - MWOAuthConsumer::STAGE_REJECTED => 'rejected', - MWOAuthConsumer::STAGE_EXPIRED => 'expired', - MWOAuthConsumer::STAGE_APPROVED => 'approved', - MWOAuthConsumer::STAGE_DISABLED => 'disabled', + self::STAGE_PROPOSED => 'proposed', + self::STAGE_REJECTED => 'rejected', + self::STAGE_EXPIRED => 'expired', + self::STAGE_APPROVED => 'approved', + self::STAGE_DISABLED => 'disabled', ]; /** @@ -104,11 +104,11 @@ * @var array */ public static $stageActionNames = [ - MWOAuthConsumer::STAGE_PROPOSED => 'propose', - MWOAuthConsumer::STAGE_REJECTED => 'reject', - MWOAuthConsumer::STAGE_EXPIRED => 'propose', - MWOAuthConsumer::STAGE_APPROVED => 'approve', - MWOAuthConsumer::STAGE_DISABLED => 'disable', + self::STAGE_PROPOSED => 'propose', + self::STAGE_REJECTED => 'reject', + self::STAGE_EXPIRED => 'propose', + self::STAGE_APPROVED => 'approve', + self::STAGE_DISABLED => 'disable', ]; protected static function getSchema() { @@ -223,11 +223,11 @@ */ public static function getAllStages() { return [ - MWOAuthConsumer::STAGE_PROPOSED, - MWOAuthConsumer::STAGE_REJECTED, - MWOAuthConsumer::STAGE_EXPIRED, - MWOAuthConsumer::STAGE_APPROVED, - MWOAuthConsumer::STAGE_DISABLED, + self::STAGE_PROPOSED, + self::STAGE_REJECTED, + self::STAGE_EXPIRED, + self::STAGE_APPROVED, + self::STAGE_DISABLED, ]; } @@ -259,7 +259,7 @@ * - Still pending approval and is owned by $user * * @param \User $user - * @return boolean + * @return bool */ public function isUsableBy( \User $user ) { if ( $this->stage === self::STAGE_APPROVED && !$this->get( 'ownerOnly' ) ) { @@ -285,7 +285,7 @@ protected function encodeRow( \DBConnRef $db, $row ) { // For compatibility with other wikis in the farm, un-remap some grants - foreach ( MWOAuthConsumer::$mapBackCompatGrants as $old => $new ) { + foreach ( self::$mapBackCompatGrants as $old => $new ) { while ( ( $i = array_search( $new, $row['oarc_grants'], true ) ) !== false ) { $row['oarc_grants'][$i] = $old; } @@ -309,7 +309,7 @@ wfTimestampOrNull( TS_MW, $row['oarc_email_authenticated'] ); // For backwards compatibility, remap some grants - foreach ( MWOAuthConsumer::$mapBackCompatGrants as $old => $new ) { + foreach ( self::$mapBackCompatGrants as $old => $new ) { while ( ( $i = array_search( $old, $row['oarc_grants'], true ) ) !== false ) { $row['oarc_grants'][$i] = $new; } diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php index 68fef92..338f0a8 100644 --- a/backend/MWOAuthDataStore.php +++ b/backend/MWOAuthDataStore.php @@ -103,7 +103,7 @@ * @param String $token * @param String $nonce * @param int $timestamp - * @return boolean + * @return bool */ public function lookup_nonce( $consumer, $token, $nonce, $timestamp ) { $key = MWOAuthUtils::getCacheKey( 'nonce', $consumer->key, $token, $nonce ); @@ -138,7 +138,7 @@ * @return MWOAuthToken */ public function new_request_token( $consumer, $callback = 'oob' ) { - $token = MWOAuthDataStore::newToken(); + $token = self::newToken(); $cacheConsumerKey = MWOAuthUtils::getCacheKey( 'consumer', 'request', $token->key ); $cacheTokenKey = MWOAuthUtils::getCacheKey( 'token', $consumer->key, 'request', $token->key diff --git a/backend/MWOAuthUtils.php b/backend/MWOAuthUtils.php index 8a5e86d..2fc7845 100644 --- a/backend/MWOAuthUtils.php +++ b/backend/MWOAuthUtils.php @@ -191,9 +191,9 @@ * @return MWOAuthServer with default configurations */ public static function newMWOAuthServer() { - $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE ); - $dbw = wfGetLB()->getServerCount() > 1 ? MWOAuthUtils::getCentralDB( DB_MASTER ) : null; - $store = new MWOAuthDataStore( $dbr, $dbw, MWOAuthUtils::getSessionCache() ); + $dbr = self::getCentralDB( DB_SLAVE ); + $dbw = wfGetLB()->getServerCount() > 1 ? self::getCentralDB( DB_MASTER ) : null; + $store = new MWOAuthDataStore( $dbr, $dbw, self::getSessionCache() ); $server = new MWOAuthServer( $store ); $server->add_signature_method( new OAuthSignatureMethod_HMAC_SHA1() ); $server->add_signature_method( new MWOAuthSignatureMethod_RSA_SHA1( $store ) ); @@ -379,7 +379,7 @@ */ public static function locateUsersToNotify( EchoEvent $event ) { $agent = $event->getAgent(); - $owner = MWOAuthUtils::getLocalUserFromCentralId( $event->getExtraParam( 'owner-id' ) ); + $owner = self::getLocalUserFromCentralId( $event->getExtraParam( 'owner-id' ) ); $users = []; switch ( $event->getType() ) { diff --git a/composer.json b/composer.json index be2d32a..1a6879a 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ }, "require-dev": { "jakub-onderka/php-parallel-lint": "0.9", - "mediawiki/mediawiki-codesniffer": "0.10.0", + "mediawiki/mediawiki-codesniffer": "0.10.1", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { diff --git a/frontend/MWOAuthUI.hooks.php b/frontend/MWOAuthUI.hooks.php index 52276a6..194a1e7 100644 --- a/frontend/MWOAuthUI.hooks.php +++ b/frontend/MWOAuthUI.hooks.php @@ -98,7 +98,7 @@ * Append OAuth-specific grants to Special:ListGrants * @param SpecialPage $special * @param string $par - * @return boolean + * @return bool */ public static function onSpecialPageAfterExecute( SpecialPage $special, $par ) { if ( $special->getName() != 'Listgrants' ) { @@ -156,7 +156,7 @@ * Add additional text to Special:BotPasswords * @param string $name Special page name * @param HTMLForm $form - * @return boolean + * @return bool */ public static function onSpecialPageBeforeFormDisplay( $name, HTMLForm $form ) { global $wgMWOAuthCentralWiki; diff --git a/phpcs.xml b/phpcs.xml index 993adc5..61024c7 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -16,8 +16,6 @@ <file>.</file> <arg name="extensions" value="php,php5,inc"/> <arg name="encoding" value="UTF-8"/> - <exclude-pattern>vendor/</exclude-pattern> - <exclude-pattern>node_modules/</exclude-pattern> <exclude-pattern type="relative">^lib/</exclude-pattern> <exclude-pattern type="relative">^tests/lib/</exclude-pattern> </ruleset> -- To view, visit https://gerrit.wikimedia.org/r/368041 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib920133c0b840c7e5729682231e155a3854d3982 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/OAuth Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits