mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2025-01-05 11:25:24 +00:00
build: Updating mediawiki/mediawiki-codesniffer to 0.10.1
Change-Id: I2326cf81e907f2a02615f96f922b66fd2806defd
This commit is contained in:
parent
1961ffaea8
commit
79b6f470af
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"jakub-onderka/php-parallel-lint": "0.9.2",
|
"jakub-onderka/php-parallel-lint": "0.9.2",
|
||||||
"mediawiki/mediawiki-codesniffer": "0.10.0",
|
"mediawiki/mediawiki-codesniffer": "0.10.1",
|
||||||
"jakub-onderka/php-console-highlighter": "0.3.2"
|
"jakub-onderka/php-console-highlighter": "0.3.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": [
|
"test": [
|
||||||
"parallel-lint . --exclude vendor",
|
"parallel-lint . --exclude vendor",
|
||||||
"phpcs -p"
|
"phpcs -p -s"
|
||||||
],
|
],
|
||||||
"fix": [
|
"fix": [
|
||||||
"phpcbf"
|
"phpcbf"
|
||||||
|
|
|
@ -227,7 +227,7 @@ class EchoAttributeManager {
|
||||||
*
|
*
|
||||||
* @param User
|
* @param User
|
||||||
* @param string A notification category defined in $wgEchoNotificationCategories
|
* @param string A notification category defined in $wgEchoNotificationCategories
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getCategoryEligibility( $user, $category ) {
|
public function getCategoryEligibility( $user, $category ) {
|
||||||
$usersGroups = $user->getGroups();
|
$usersGroups = $user->getGroups();
|
||||||
|
@ -245,7 +245,7 @@ class EchoAttributeManager {
|
||||||
* Get the priority for a specific notification type
|
* Get the priority for a specific notification type
|
||||||
*
|
*
|
||||||
* @param string A notification type defined in $wgEchoNotifications
|
* @param string A notification type defined in $wgEchoNotifications
|
||||||
* @return integer From 1 to 10 (10 is default)
|
* @return int From 1 to 10 (10 is default)
|
||||||
*/
|
*/
|
||||||
public function getNotificationPriority( $notificationType ) {
|
public function getNotificationPriority( $notificationType ) {
|
||||||
$category = $this->getNotificationCategory( $notificationType );
|
$category = $this->getNotificationCategory( $notificationType );
|
||||||
|
@ -257,7 +257,7 @@ class EchoAttributeManager {
|
||||||
* Get the priority for a notification category
|
* Get the priority for a notification category
|
||||||
*
|
*
|
||||||
* @param string A notification category defined in $wgEchoNotificationCategories
|
* @param string A notification category defined in $wgEchoNotificationCategories
|
||||||
* @return integer From 1 to 10 (10 is default)
|
* @return int From 1 to 10 (10 is default)
|
||||||
*/
|
*/
|
||||||
public function getCategoryPriority( $category ) {
|
public function getCategoryPriority( $category ) {
|
||||||
if ( isset( $this->categories[$category]['priority'] ) ) {
|
if ( isset( $this->categories[$category]['priority'] ) ) {
|
||||||
|
|
|
@ -107,7 +107,7 @@ class EchoContainmentSet {
|
||||||
* Test the wrapped lists for existence of $value
|
* Test the wrapped lists for existence of $value
|
||||||
*
|
*
|
||||||
* @param $value mixed The value to look for
|
* @param $value mixed The value to look for
|
||||||
* @return boolean True when the set contains the provided value
|
* @return bool True when the set contains the provided value
|
||||||
*/
|
*/
|
||||||
public function contains( $value ) {
|
public function contains( $value ) {
|
||||||
foreach ( $this->lists as $list ) {
|
foreach ( $this->lists as $list ) {
|
||||||
|
|
|
@ -232,7 +232,7 @@ class MWEchoNotifUser {
|
||||||
$eventTypesToLoad = $attributeManager->getUserEnabledEventsbySections( $this->mUser, 'web', [ $section ] );
|
$eventTypesToLoad = $attributeManager->getUserEnabledEventsbySections( $this->mUser, 'web', [ $section ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = (int)$this->userNotifGateway->getCappedNotificationCount( $dbSource, $eventTypesToLoad, MWEchoNotifUser::MAX_BADGE_COUNT + 1 );
|
$count = (int)$this->userNotifGateway->getCappedNotificationCount( $dbSource, $eventTypesToLoad, self::MAX_BADGE_COUNT + 1 );
|
||||||
|
|
||||||
if ( $global ) {
|
if ( $global ) {
|
||||||
$count = self::capNotificationCount( $count + $this->getForeignCount( $section ) );
|
$count = self::capNotificationCount( $count + $this->getForeignCount( $section ) );
|
||||||
|
@ -349,7 +349,7 @@ class MWEchoNotifUser {
|
||||||
/**
|
/**
|
||||||
* Mark one or more notifications read for a user.
|
* Mark one or more notifications read for a user.
|
||||||
* @param $eventIds Array of event IDs to mark read
|
* @param $eventIds Array of event IDs to mark read
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function markRead( $eventIds ) {
|
public function markRead( $eventIds ) {
|
||||||
$eventIds = array_filter( (array)$eventIds, 'is_numeric' );
|
$eventIds = array_filter( (array)$eventIds, 'is_numeric' );
|
||||||
|
@ -381,7 +381,7 @@ class MWEchoNotifUser {
|
||||||
/**
|
/**
|
||||||
* Mark one or more notifications unread for a user.
|
* Mark one or more notifications unread for a user.
|
||||||
* @param $eventIds Array of event IDs to mark unread
|
* @param $eventIds Array of event IDs to mark unread
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function markUnRead( $eventIds ) {
|
public function markUnRead( $eventIds ) {
|
||||||
$eventIds = array_filter( (array)$eventIds, 'is_numeric' );
|
$eventIds = array_filter( (array)$eventIds, 'is_numeric' );
|
||||||
|
@ -418,7 +418,7 @@ class MWEchoNotifUser {
|
||||||
* across multiple tables, we would visit this later
|
* across multiple tables, we would visit this later
|
||||||
*
|
*
|
||||||
* @param string[] $sections
|
* @param string[] $sections
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function markAllRead( array $sections = [ EchoAttributeManager::ALL ] ) {
|
public function markAllRead( array $sections = [ EchoAttributeManager::ALL ] ) {
|
||||||
if ( wfReadOnly() ) {
|
if ( wfReadOnly() ) {
|
||||||
|
@ -789,6 +789,6 @@ class MWEchoNotifUser {
|
||||||
* @return int Capped notification count
|
* @return int Capped notification count
|
||||||
*/
|
*/
|
||||||
public static function capNotificationCount( $number ) {
|
public static function capNotificationCount( $number ) {
|
||||||
return min( $number, MWEchoNotifUser::MAX_BADGE_COUNT + 1 );
|
return min( $number, self::MAX_BADGE_COUNT + 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ class EchoNotificationController {
|
||||||
*
|
*
|
||||||
* @param EchoEvent $event The event to test for exclusion
|
* @param EchoEvent $event The event to test for exclusion
|
||||||
* @param User $user recipient of the notification for per-user blacklists
|
* @param User $user recipient of the notification for per-user blacklists
|
||||||
* @return boolean True when the event agent is blacklisted
|
* @return bool True when the event agent is blacklisted
|
||||||
*/
|
*/
|
||||||
public static function isBlacklistedByUser( EchoEvent $event, User $user ) {
|
public static function isBlacklistedByUser( EchoEvent $event, User $user ) {
|
||||||
global $wgEchoAgentBlacklist, $wgEchoPerUserBlacklist;
|
global $wgEchoAgentBlacklist, $wgEchoPerUserBlacklist;
|
||||||
|
@ -277,7 +277,7 @@ class EchoNotificationController {
|
||||||
*
|
*
|
||||||
* @param EchoEvent $event The event to test for inclusion in whitelist
|
* @param EchoEvent $event The event to test for inclusion in whitelist
|
||||||
* @param User $user The user that owns the whitelist
|
* @param User $user The user that owns the whitelist
|
||||||
* @return boolean True when the event agent is in the user whitelist
|
* @return bool True when the event agent is in the user whitelist
|
||||||
*/
|
*/
|
||||||
public static function isWhitelistedByUser( EchoEvent $event, User $user ) {
|
public static function isWhitelistedByUser( EchoEvent $event, User $user ) {
|
||||||
$clusterCache = ObjectCache::getLocalClusterInstance();
|
$clusterCache = ObjectCache::getLocalClusterInstance();
|
||||||
|
|
|
@ -57,7 +57,7 @@ trait EchoPresentationModelSectionTrait {
|
||||||
* This also returns false if the revision is deleted,
|
* This also returns false if the revision is deleted,
|
||||||
* even if there is a section, because the section can't
|
* even if there is a section, because the section can't
|
||||||
* be viewed in that case.
|
* be viewed in that case.
|
||||||
* @return boolean Whether there is a section
|
* @return bool Whether there is a section
|
||||||
*/
|
*/
|
||||||
protected function hasSection() {
|
protected function hasSection() {
|
||||||
return (bool)$this->getRawSectionTitle();
|
return (bool)$this->getRawSectionTitle();
|
||||||
|
|
|
@ -35,7 +35,7 @@ class EchoUserNotificationGateway {
|
||||||
/**
|
/**
|
||||||
* Mark notifications as read
|
* Mark notifications as read
|
||||||
* @param $eventIDs array
|
* @param $eventIDs array
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function markRead( array $eventIDs ) {
|
public function markRead( array $eventIDs ) {
|
||||||
if ( !$eventIDs ) {
|
if ( !$eventIDs ) {
|
||||||
|
@ -59,7 +59,7 @@ class EchoUserNotificationGateway {
|
||||||
/**
|
/**
|
||||||
* Mark notifications as unread
|
* Mark notifications as unread
|
||||||
* @param $eventIDs array
|
* @param $eventIDs array
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function markUnRead( array $eventIDs ) {
|
public function markUnRead( array $eventIDs ) {
|
||||||
if ( !$eventIDs ) {
|
if ( !$eventIDs ) {
|
||||||
|
|
|
@ -347,7 +347,7 @@ class EchoNotificationMapper extends EchoAbstractMapper {
|
||||||
* Batch delete notifications by user and eventId offset
|
* Batch delete notifications by user and eventId offset
|
||||||
* @param User $user
|
* @param User $user
|
||||||
* @param int $eventId
|
* @param int $eventId
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function deleteByUserEventOffset( User $user, $eventId ) {
|
public function deleteByUserEventOffset( User $user, $eventId ) {
|
||||||
$dbw = $this->dbFactory->getEchoDb( DB_MASTER );
|
$dbw = $this->dbFactory->getEchoDb( DB_MASTER );
|
||||||
|
|
|
@ -18,7 +18,7 @@ class EchoTargetPageMapper extends EchoAbstractMapper {
|
||||||
* Insert an EchoTargetPage instance into the database
|
* Insert an EchoTargetPage instance into the database
|
||||||
*
|
*
|
||||||
* @param EchoTargetPage $targetPage
|
* @param EchoTargetPage $targetPage
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function insert( EchoTargetPage $targetPage ) {
|
public function insert( EchoTargetPage $targetPage ) {
|
||||||
$dbw = $this->dbFactory->getEchoDb( DB_MASTER );
|
$dbw = $this->dbFactory->getEchoDb( DB_MASTER );
|
||||||
|
|
|
@ -575,7 +575,7 @@ class EchoEvent extends EchoAbstractEntity implements Bundleable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether an event can use the job queue, or should be immediate
|
* Determine whether an event can use the job queue, or should be immediate
|
||||||
* @return boolean
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getUseJobQueue() {
|
public function getUseJobQueue() {
|
||||||
global $wgEchoNotifications;
|
global $wgEchoNotifications;
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
|
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
|
||||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
||||||
</rule>
|
</rule>
|
||||||
<arg name="encoding" value="utf8" />
|
<arg name="encoding" value="UTF-8" />
|
||||||
<arg name="extensions" value="php,php5,inc" />
|
<arg name="extensions" value="php,php5,inc" />
|
||||||
<arg name="colors" />
|
<arg name="colors" />
|
||||||
<exclude-pattern>vendor</exclude-pattern>
|
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|
Loading…
Reference in a new issue