Improve function and property documentation

Change-Id: I16cc3831cd4c917aa679c7f7c535b97e498291a7
This commit is contained in:
Umherirrender 2021-01-15 21:57:04 +01:00
parent fbd373b5d7
commit 09b331ab83
6 changed files with 17 additions and 11 deletions

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset> <ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.PropertyDocumentation.WrongStyle" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
</rule> </rule>
<file>.</file> <file>.</file>

View file

@ -63,10 +63,10 @@ final class MinervaPagePermissions implements IMinervaPagePermissions {
*/ */
private $languagesHelper; private $languagesHelper;
/** /**
* @var PermissionManager MediaWiki Core PermissionManager * @var PermissionManager MediaWiki Core PermissionManager
*/ */
private $permissionManager; private $permissionManager;
/** /**
* Initialize internal Minerva Permissions system * Initialize internal Minerva Permissions system

View file

@ -37,9 +37,11 @@ final class SkinOptions {
public const PERSONAL_MENU = 'personalMenu'; public const PERSONAL_MENU = 'personalMenu';
public const SIMPLIFIED_TALK = 'simplifiedTalk'; public const SIMPLIFIED_TALK = 'simplifiedTalk';
/** @var array skin specific options, initialized with default values */ /**
// Note stable skin options default to true for desktop-Minerva and are expected to be * Note stable skin options default to true for desktop-Minerva and are expected to be
// overridden on mobile. * overridden on mobile.
* @var array skin specific options, initialized with default values
*/
private $skinOptions = [ private $skinOptions = [
self::BETA_MODE => false, self::BETA_MODE => false,
self::SHOW_DONATE => true, self::SHOW_DONATE => true,

View file

@ -11,6 +11,7 @@ use MediaWiki\Minerva\Menu\Group;
* @coversDefaultClass \MediaWiki\Minerva\Menu\Group * @coversDefaultClass \MediaWiki\Minerva\Menu\Group
*/ */
class GroupTest extends \MediaWikiTestCase { class GroupTest extends \MediaWikiTestCase {
/** @var string[] */
private $homeComponent = [ private $homeComponent = [
'text' => 'Home', 'text' => 'Home',
'href' => '/Main_page', 'href' => '/Main_page',
@ -18,6 +19,7 @@ class GroupTest extends \MediaWikiTestCase {
'data-event-name' => 'home', 'data-event-name' => 'home',
]; ];
/** @var string[] */
private $nearbyComponent = [ private $nearbyComponent = [
'text' => 'Nearby', 'text' => 'Nearby',
'href' => '/wiki/Special:Nearby', 'href' => '/wiki/Special:Nearby',

View file

@ -17,6 +17,9 @@ use Wikimedia\TestingAccessWrapper;
class SkinMinervaTest extends MediaWikiTestCase { class SkinMinervaTest extends MediaWikiTestCase {
private const OPTIONS_MODULE = 'skins.minerva.options'; private const OPTIONS_MODULE = 'skins.minerva.options';
/**
* @param array $options
*/
private function overrideSkinOptions( $options ) { private function overrideSkinOptions( $options ) {
$mockOptions = new SkinOptions(); $mockOptions = new SkinOptions();
$mockOptions->setMultiple( $options ); $mockOptions->setMultiple( $options );
@ -109,9 +112,9 @@ class SkinMinervaTest extends MediaWikiTestCase {
/** /**
* Test whether the font changer module is correctly added to the list context modules. * Test whether the font changer module is correctly added to the list context modules.
* *
* @covers ::getContextSpecificModules * @covers ::getContextSpecificModules
* @dataProvider provideGetContextSpecificModules * @dataProvider provideGetContextSpecificModules
* @param mixed $categoryLinks whether category link feature is enabled * @param mixed $categoryLinks whether category link feature is enabled
* @param string $moduleName Module name that is being tested * @param string $moduleName Module name that is being tested
* @param bool $expected Whether the module is expected to be returned by the function being tested * @param bool $expected Whether the module is expected to be returned by the function being tested
*/ */

View file

@ -29,7 +29,7 @@ class LanguagesHelperTest extends \MediaWikiUnitTestCase {
/** /**
* Build test Title object * Build test Title object
* @param $hasVariants * @param bool $hasVariants
* @param Invocation|null $matcher * @param Invocation|null $matcher
* @return \Title * @return \Title
*/ */