Follows-up
9b4938c40d02c,
4bff6f1558, and
766549999c.
It seems despite being optional and documented as 'array|Title',
Phan still thinks it is wrong to pass Title.
Try removing the explicit default of empty array,
the lower code already does this anyway.
This should fix build failures that are preventing merges
in repos where Phan is finding Job::__construct(string, Title)
where it currently fails as follows:
CompileArticleMetadataJob.php:11
PhanTypeMismatchArgument Argument 2 (params) is …\Title|string but
\Job::__construct() takes array
Change-Id: I1c3aee273e0917e30b9c18b49b24fc7f966ff57c
/**
* @param string $command
/**
* @param string $command
- * @param array|Title $params
+ * @param array|Title|null $params
- public function __construct( $command, $params = [] ) {
+ public function __construct( $command, $params = null ) {
if ( $params instanceof Title ) {
// Backwards compatibility for old signature ($command, $title, $params)
$title = $params;
if ( $params instanceof Title ) {
// Backwards compatibility for old signature ($command, $title, $params)
$title = $params;
- $params = func_num_args() >= 3 ? func_get_arg( 2 ) : [];
+ $params = func_get_arg( 2 );
} else {
// Subclasses can override getTitle() to return something more meaningful
$title = Title::makeTitle( NS_SPECIAL, 'Blankpage' );
} else {
// Subclasses can override getTitle() to return something more meaningful
$title = Title::makeTitle( NS_SPECIAL, 'Blankpage' );
$this->command = $command;
$this->title = $title;
$this->command = $command;
$this->title = $title;
- $this->params = is_array( $params ) ? $params : []; // sanity
+ $this->params = is_array( $params ) ? $params : [];
if ( !isset( $this->params['requestId'] ) ) {
$this->params['requestId'] = WebRequest::getRequestId();
}
if ( !isset( $this->params['requestId'] ) ) {
$this->params['requestId'] = WebRequest::getRequestId();
}