From 09b331ab83d6820fe9f942647b2c43949707aff7 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Fri, 15 Jan 2021 21:57:04 +0100 Subject: [PATCH] Improve function and property documentation Change-Id: I16cc3831cd4c917aa679c7f7c535b97e498291a7 --- .phpcs.xml | 1 - includes/Permissions/MinervaPagePermissions.php | 8 ++++---- includes/SkinOptions.php | 8 +++++--- tests/phpunit/menu/GroupTest.php | 2 ++ tests/phpunit/skins/SkinMinervaTest.php | 7 +++++-- tests/phpunit/unit/LanguagesHelperTest.php | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index dc8ac3f90..9dc6b7dc5 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,7 +1,6 @@ - . diff --git a/includes/Permissions/MinervaPagePermissions.php b/includes/Permissions/MinervaPagePermissions.php index 3c610dadd..6ddabb577 100644 --- a/includes/Permissions/MinervaPagePermissions.php +++ b/includes/Permissions/MinervaPagePermissions.php @@ -63,10 +63,10 @@ final class MinervaPagePermissions implements IMinervaPagePermissions { */ private $languagesHelper; - /** - * @var PermissionManager MediaWiki Core PermissionManager - */ - private $permissionManager; + /** + * @var PermissionManager MediaWiki Core PermissionManager + */ + private $permissionManager; /** * Initialize internal Minerva Permissions system diff --git a/includes/SkinOptions.php b/includes/SkinOptions.php index 137a072dc..9c581c470 100644 --- a/includes/SkinOptions.php +++ b/includes/SkinOptions.php @@ -37,9 +37,11 @@ final class SkinOptions { public const PERSONAL_MENU = 'personalMenu'; 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 - // overridden on mobile. + /** + * Note stable skin options default to true for desktop-Minerva and are expected to be + * overridden on mobile. + * @var array skin specific options, initialized with default values + */ private $skinOptions = [ self::BETA_MODE => false, self::SHOW_DONATE => true, diff --git a/tests/phpunit/menu/GroupTest.php b/tests/phpunit/menu/GroupTest.php index 86494bc2d..742d98614 100644 --- a/tests/phpunit/menu/GroupTest.php +++ b/tests/phpunit/menu/GroupTest.php @@ -11,6 +11,7 @@ use MediaWiki\Minerva\Menu\Group; * @coversDefaultClass \MediaWiki\Minerva\Menu\Group */ class GroupTest extends \MediaWikiTestCase { + /** @var string[] */ private $homeComponent = [ 'text' => 'Home', 'href' => '/Main_page', @@ -18,6 +19,7 @@ class GroupTest extends \MediaWikiTestCase { 'data-event-name' => 'home', ]; + /** @var string[] */ private $nearbyComponent = [ 'text' => 'Nearby', 'href' => '/wiki/Special:Nearby', diff --git a/tests/phpunit/skins/SkinMinervaTest.php b/tests/phpunit/skins/SkinMinervaTest.php index eead6d499..4d08ca69c 100644 --- a/tests/phpunit/skins/SkinMinervaTest.php +++ b/tests/phpunit/skins/SkinMinervaTest.php @@ -17,6 +17,9 @@ use Wikimedia\TestingAccessWrapper; class SkinMinervaTest extends MediaWikiTestCase { private const OPTIONS_MODULE = 'skins.minerva.options'; + /** + * @param array $options + */ private function overrideSkinOptions( $options ) { $mockOptions = new SkinOptions(); $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. * - * @covers ::getContextSpecificModules + * @covers ::getContextSpecificModules * @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 bool $expected Whether the module is expected to be returned by the function being tested */ diff --git a/tests/phpunit/unit/LanguagesHelperTest.php b/tests/phpunit/unit/LanguagesHelperTest.php index 5e6a1d93d..394e24d90 100644 --- a/tests/phpunit/unit/LanguagesHelperTest.php +++ b/tests/phpunit/unit/LanguagesHelperTest.php @@ -29,7 +29,7 @@ class LanguagesHelperTest extends \MediaWikiUnitTestCase { /** * Build test Title object - * @param $hasVariants + * @param bool $hasVariants * @param Invocation|null $matcher * @return \Title */