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