mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-23 10:19:35 +00:00
Add phan
Change-Id: I7352036536c1c8415b681f48f3ee0dcec315c035
This commit is contained in:
parent
cdb3b880af
commit
e1442aa343
3
.phan/config.php
Normal file
3
.phan/config.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
32
.phan/stubs/FlaggedRevs.php
Normal file
32
.phan/stubs/FlaggedRevs.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
// @phpcs:disable MediaWiki.Files.ClassMatchesFilename.NotMatch
|
||||
|
||||
/**
|
||||
* Phan stub for the soft dependency to FlaggedRevs extension
|
||||
* There is no hard dependency and VisualEditor is a dependency to many other extensions,
|
||||
* so this class is stubbed and not verified against the original class
|
||||
*/
|
||||
class FlaggablePageView extends ContextSource {
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function singleton() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true
|
||||
*/
|
||||
public function displayTag() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool &$outputDone
|
||||
* @param bool &$useParserCache
|
||||
* @return bool
|
||||
*/
|
||||
public function setPageContent( &$outputDone, &$useParserCache ) {
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,8 @@
|
|||
"jakub-onderka/php-parallel-lint": "1.0.0",
|
||||
"jakub-onderka/php-console-highlighter": "0.3.2",
|
||||
"mediawiki/mediawiki-codesniffer": "24.0.0",
|
||||
"mediawiki/minus-x": "0.3.1"
|
||||
"mediawiki/minus-x": "0.3.1",
|
||||
"mediawiki/mediawiki-phan-config": "0.6.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
|
|
|
@ -288,9 +288,11 @@ class ApiVisualEditor extends ApiBase {
|
|||
if ( $section !== null ) {
|
||||
$sectionContent = new WikitextContent( $wikitext );
|
||||
$page = WikiPage::factory( $title );
|
||||
$wikitext = $page->replaceSectionAtRev(
|
||||
$newSectionContent = $page->replaceSectionAtRev(
|
||||
$section, $sectionContent, '', $oldid
|
||||
)->getText();
|
||||
);
|
||||
'@phan-var WikitextContent $newSectionContent';
|
||||
$wikitext = $newSectionContent->getText();
|
||||
}
|
||||
$response = $this->parseWikitextFragment(
|
||||
$title, $wikitext, false, $oldid, $stash
|
||||
|
@ -544,6 +546,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
// See discussion on <https://gerrit.wikimedia.org/r/c/mediawiki/core/+/506945>.
|
||||
if ( method_exists( $this, 'getBlockInfo' ) ) {
|
||||
// old name
|
||||
/** @phan-suppress-next-line PhanUndeclaredMethod */
|
||||
$blockinfo = $this->getBlockInfo( $block );
|
||||
} else {
|
||||
// new name
|
||||
|
@ -587,7 +590,9 @@ class ApiVisualEditor extends ApiBase {
|
|||
$options['title-message'] = $this->msg( $options['title-message'] )->getKey();
|
||||
}
|
||||
}
|
||||
/** @phan-suppress-next-line PhanTypeArraySuspiciousNullable */
|
||||
$checkboxesMessagesList[] = $options['label-message'];
|
||||
/** @phan-suppress-next-line PhanTypeArraySuspiciousNullable */
|
||||
if ( !is_string( $options['label-message'] ) ) {
|
||||
// Extract only the key. Any parameters are included in the fake message definition
|
||||
// passed via $checkboxesMessages. (This changes $checkboxesDef by reference.)
|
||||
|
|
|
@ -626,6 +626,7 @@ class VisualEditorHooks {
|
|||
$veLink = [
|
||||
'text' => $skin->msg( $veEditSection )->inLanguage( $lang )->text(),
|
||||
'targetTitle' => $title,
|
||||
/** @phan-suppress-next-line PhanTypeInvalidDimOffset */
|
||||
'attribs' => $result['editsection']['attribs'] + [
|
||||
'class' => 'mw-editsection-visualeditor'
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue