Add phan
Bug: T133664 Change-Id: I26f8cfe8cb88ed7de88e765681d9334edd9f3ce4
This commit is contained in:
parent
e01cb1fa14
commit
b5c6658813
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
||||
|
||||
$cfg['directory_list'] = array_merge(
|
||||
$cfg['directory_list'],
|
||||
[
|
||||
'../../extensions/MobileFrontend',
|
||||
'../../extensions/Echo',
|
||||
]
|
||||
);
|
||||
|
||||
$cfg['exclude_analysis_directory_list'] = array_merge(
|
||||
$cfg['exclude_analysis_directory_list'],
|
||||
[
|
||||
'../../extensions/MobileFrontend',
|
||||
'../../extensions/Echo',
|
||||
]
|
||||
);
|
||||
|
||||
return $cfg;
|
|
@ -3,7 +3,8 @@
|
|||
"jakub-onderka/php-parallel-lint": "1.0.0",
|
||||
"mediawiki/mediawiki-codesniffer": "24.0.0",
|
||||
"jakub-onderka/php-console-highlighter": "0.3.2",
|
||||
"mediawiki/minus-x": "0.3.1"
|
||||
"mediawiki/minus-x": "0.3.1",
|
||||
"mediawiki/mediawiki-phan-config": "0.6.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
|
|
|
@ -40,7 +40,7 @@ final class PageActionsDirector {
|
|||
private $overflowBuilder;
|
||||
|
||||
/**
|
||||
* @var MessageLocalizers
|
||||
* @var MessageLocalizer
|
||||
*/
|
||||
private $messageLocalizer;
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ final class MinervaPagePermissions implements IMinervaPagePermissions {
|
|||
* </ul>
|
||||
*
|
||||
* The "edit" action is not allowed if editing is not possible on the page
|
||||
* see @method: isCurrentPageContentModelEditable
|
||||
* @see method isCurrentPageContentModelEditable
|
||||
*
|
||||
* The "switch-language" is allowed if there are interlanguage links on the page,
|
||||
* or <code>$wgMinervaAlwaysShowLanguageButton</code> is truthy.
|
||||
|
|
|
@ -33,6 +33,9 @@ class MinervaTemplate extends BaseTemplate {
|
|||
/** @var bool Specify whether the page is main page */
|
||||
protected $isMainPage;
|
||||
|
||||
/** @var bool */
|
||||
protected $isMainPageTalk;
|
||||
|
||||
/**
|
||||
* Start render the page in template
|
||||
*/
|
||||
|
@ -87,7 +90,7 @@ class MinervaTemplate extends BaseTemplate {
|
|||
'headinghtml' => $data['footer-site-heading-html'],
|
||||
// Note mobile-license is only available on the mobile skin. It is outputted as part of
|
||||
// footer-info on desktop hence the conditional check.
|
||||
'licensehtml' => isset( $data['mobile-license'] ) ? $data['mobile-license'] : '',
|
||||
'licensehtml' => $data['mobile-license'] ?? '',
|
||||
'lists' => $groups,
|
||||
];
|
||||
}
|
||||
|
@ -145,7 +148,7 @@ class MinervaTemplate extends BaseTemplate {
|
|||
|
||||
/**
|
||||
* Get page secondary actions
|
||||
* @return string[]
|
||||
* @return array
|
||||
*/
|
||||
protected function getSecondaryActions() {
|
||||
if ( $this->isFallbackEditor() ) {
|
||||
|
@ -158,6 +161,8 @@ class MinervaTemplate extends BaseTemplate {
|
|||
/**
|
||||
* Get HTML representing secondary page actions like language selector
|
||||
* @return string
|
||||
* @suppress PhanTypeArraySuspiciousNullable,PhanTypeMismatchArgument The array shape of
|
||||
* $el is too complicated, and not inferred correctly
|
||||
*/
|
||||
protected function getSecondaryActionsHtml() {
|
||||
$baseClass = MinervaUI::buttonClass( '', 'button' );
|
||||
|
@ -227,7 +232,7 @@ class MinervaTemplate extends BaseTemplate {
|
|||
$templateParser = new TemplateParser( __DIR__ );
|
||||
|
||||
$internalBanner = $data[ 'internalBanner' ];
|
||||
$preBodyHtml = isset( $data['prebodyhtml'] ) ? $data['prebodyhtml'] : '';
|
||||
$preBodyHtml = $data['prebodyhtml'] ?? '';
|
||||
$hasHeadingHolder = $internalBanner || $preBodyHtml || isset( $data['page_actions'] );
|
||||
$hasPageActions = $this->hasPageActions( $data['skin']->getContext() );
|
||||
|
||||
|
@ -257,8 +262,8 @@ class MinervaTemplate extends BaseTemplate {
|
|||
'taglinehtml' => $data['taglinehtml'],
|
||||
'internalBanner' => $internalBanner,
|
||||
'prebodyhtml' => $preBodyHtml,
|
||||
'headinghtml' => isset( $data['headinghtml'] ) ? $data['headinghtml'] : '',
|
||||
'postheadinghtml' => isset( $data['postheadinghtml'] ) ? $data['postheadinghtml'] : '',
|
||||
'headinghtml' => $data['headinghtml'] ?? '',
|
||||
'postheadinghtml' => $data['postheadinghtml'] ?? '',
|
||||
'haspageactions' => $hasPageActions,
|
||||
'pageactionshtml' => $hasPageActions ? $this->getPageActionsHtml() : '',
|
||||
'subtitle' => $data['subtitle'],
|
||||
|
|
|
@ -76,8 +76,7 @@ class SkinMinerva extends SkinTemplate {
|
|||
|
||||
/**
|
||||
* Initalized main menu. Please use getter.
|
||||
* @return MainMenuDirector
|
||||
*
|
||||
* @var MainMenuDirector
|
||||
*/
|
||||
private $mainMenu;
|
||||
|
||||
|
@ -135,6 +134,7 @@ class SkinMinerva extends SkinTemplate {
|
|||
/**
|
||||
* initialize various variables and generate the template
|
||||
* @return QuickTemplate
|
||||
* @suppress PhanTypeMismatchArgument
|
||||
*/
|
||||
protected function prepareQuickTemplate() {
|
||||
$out = $this->getOutput();
|
||||
|
@ -710,7 +710,7 @@ class SkinMinerva extends SkinTemplate {
|
|||
/**
|
||||
* Returns an array of links for page secondary actions
|
||||
* @param BaseTemplate $tpl
|
||||
* @return string[]
|
||||
* @return array
|
||||
*/
|
||||
protected function getSecondaryActions( BaseTemplate $tpl ) {
|
||||
$buttons = [];
|
||||
|
|
Loading…
Reference in New Issue