mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Add some missing newlines to separate PHP code better
I believe these additional newlines all make the code easier to read. It's easier to see what belongs together, and what is a separate thing. I found the Squiz.WhiteSpace.FunctionSpacing sniff very helpful to enforce this code style. We enabled this already in almost all WMDE codebases. It is not yet part of the upstream MediaWiki rule set, but discussed. Change-Id: Ibdf788529b28637bf98e7940c2516852c3afcef7
This commit is contained in:
parent
1e620a5df8
commit
e32fc4914e
|
@ -5,6 +5,11 @@
|
|||
<rule ref="Squiz.Strings.DoubleQuoteUsage">
|
||||
<exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar" />
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
|
||||
<properties>
|
||||
<property name="spacing" value="1" />
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php,php5,inc" />
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
namespace Popups\EventLogging;
|
||||
|
||||
interface EventLogger {
|
||||
|
||||
/**
|
||||
* Page Previews Event logging schema name
|
||||
*/
|
||||
|
|
|
@ -50,4 +50,5 @@ class MWEventLogger implements EventLogger {
|
|||
$event
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,4 +88,5 @@ class PopupsGadgetsIntegration {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ use BetaFeatures;
|
|||
* @package Popups
|
||||
*/
|
||||
class PopupsHooks {
|
||||
|
||||
const PREVIEWS_PREFERENCES_SECTION = 'rendering/reading';
|
||||
|
||||
/**
|
||||
|
@ -226,4 +227,5 @@ class PopupsHooks {
|
|||
];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ use HTMLForm;
|
|||
* @package Popups
|
||||
*/
|
||||
class UserPreferencesChangeHandler {
|
||||
|
||||
/**
|
||||
* @var PopupsContext
|
||||
*/
|
||||
|
@ -85,4 +86,5 @@ class UserPreferencesChangeHandler {
|
|||
) {
|
||||
self::newFromGlobalState()->doPreferencesFormPreSave( $user, $oldUserOptions );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ use Popups\PopupsContext;
|
|||
* @coversDefaultClass \Popups\PopupsContext
|
||||
*/
|
||||
class PopupsContextTest extends MediaWikiTestCase {
|
||||
|
||||
/**
|
||||
* Anonymous user id
|
||||
* @see MediaWikiTestCase::addCoreDBData()
|
||||
|
@ -280,4 +281,5 @@ class PopupsContextTest extends MediaWikiTestCase {
|
|||
$context = $this->getContext( null, null, $loggerMock );
|
||||
$context->logUserDisabledPagePreviewsEvent();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -70,4 +70,5 @@ class PopupsContextTestWrapper extends PopupsContext {
|
|||
public static function injectTestInstance( PopupsContext $testInstance ) {
|
||||
self::$instance = $testInstance;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,14 +25,17 @@ use Popups\PopupsGadgetsIntegration;
|
|||
* @coversDefaultClass \Popups\PopupsGadgetsIntegration
|
||||
*/
|
||||
class PopupsGadgetsIntegrationTest extends MediaWikiTestCase {
|
||||
|
||||
/**
|
||||
* Gadget name for testing
|
||||
*/
|
||||
const NAV_POPUPS_GADGET_NAME = 'navigation-test';
|
||||
|
||||
/**
|
||||
* Helper constants for easier reading
|
||||
*/
|
||||
const GADGET_ENABLED = true;
|
||||
|
||||
/**
|
||||
* Helper constants for easier reading
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue