Add phan configuration

Change-Id: I405d1d86e43c99fbaecf027461781bf57110421e
This commit is contained in:
Kunal Mehta 2018-04-14 02:12:39 -07:00 committed by Legoktm
parent 7efd765c85
commit efd15f5058
7 changed files with 30 additions and 10 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@
node_modules/
vendor/
composer.lock
tests/phan/issues

View file

@ -3,7 +3,8 @@
"jakub-onderka/php-parallel-lint": "1.0.0",
"mediawiki/mediawiki-codesniffer": "18.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.2.0"
},
"scripts": {
"fix": [

View file

@ -31,7 +31,7 @@ class ReplaceTextHooks {
* Adds a link to the Special:ReplaceText page at the end of a successful
* regular page move message.
*
* @param FormLayout &$form MovePageForm
* @param MovePageForm &$form
* @param Title &$ot Title object of the old article (moved from)
* @param Title &$nt Title object of the new article (moved to)
*/

View file

@ -55,12 +55,7 @@ class ReplaceTextJob extends Job {
$create_redirect = $this->params['create_redirect'];
$this->title->moveTo( $new_title, true, $reason, $create_redirect );
if ( $this->params['watch_page'] ) {
if ( class_exists( 'WatchAction' ) ) {
// Class was added in MW 1.19
WatchAction::doWatch( $new_title, $wgUser );
} else {
Action::factory( 'watch', new WikiPage( $new_title ) )->execute();
}
WatchAction::doWatch( $new_title, $wgUser );
}
$wgUser = $actual_user;
} else {

View file

@ -1,5 +1,9 @@
<?php
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\DatabasePostgres;
use Wikimedia\Rdbms\IResultWrapper;
class ReplaceTextSearch {
/**
@ -69,7 +73,7 @@ class ReplaceTextSearch {
}
/**
* @param \Wikimedia\Rdbms\Database $dbr
* @param Database $dbr
* @param string $column
* @param string $regex
* @return string query condition for regex

View file

@ -23,7 +23,7 @@ class SpecialReplaceText extends SpecialPage {
}
/**
* @inheritDoc
* @param null|string $query
*/
function execute( $query ) {
global $wgCompressRevisions, $wgExternalStores;

19
tests/phan/config.php Normal file
View file

@ -0,0 +1,19 @@
<?php
$cfg = require __DIR__ . '/../../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg['directory_list'] = array_merge(
$cfg['directory_list'],
[
'./../../extensions/AdminLinks',
]
);
$cfg['exclude_analysis_directory_list'] = array_merge(
$cfg['exclude_analysis_directory_list'],
[
'./../../extensions/AdminLinks',
]
);
return $cfg;