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:
Thiemo Kreuz 2019-02-26 11:55:57 +01:00 committed by WMDE-Fisch
parent 1e620a5df8
commit e32fc4914e
9 changed files with 18 additions and 0 deletions

View file

@ -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" />

View file

@ -21,6 +21,7 @@
namespace Popups\EventLogging;
interface EventLogger {
/**
* Page Previews Event logging schema name
*/

View file

@ -50,4 +50,5 @@ class MWEventLogger implements EventLogger {
$event
);
}
}

View file

@ -88,4 +88,5 @@ class PopupsGadgetsIntegration {
}
return false;
}
}

View file

@ -32,6 +32,7 @@ use BetaFeatures;
* @package Popups
*/
class PopupsHooks {
const PREVIEWS_PREFERENCES_SECTION = 'rendering/reading';
/**
@ -226,4 +227,5 @@ class PopupsHooks {
];
}
}
}

View file

@ -30,6 +30,7 @@ use HTMLForm;
* @package Popups
*/
class UserPreferencesChangeHandler {
/**
* @var PopupsContext
*/
@ -85,4 +86,5 @@ class UserPreferencesChangeHandler {
) {
self::newFromGlobalState()->doPreferencesFormPreSave( $user, $oldUserOptions );
}
}

View file

@ -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();
}
}

View file

@ -70,4 +70,5 @@ class PopupsContextTestWrapper extends PopupsContext {
public static function injectTestInstance( PopupsContext $testInstance ) {
self::$instance = $testInstance;
}
}

View file

@ -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
*/