Add lots of missing return statements, or remove incorrect doc blocks.
Change-Id: I0881e98fbb9d0d4cf79ecc824064d24538055d3f
"PhanTypeExpectedObjectOrClassName",
// approximate error count: 7
"PhanTypeExpectedObjectPropAccess",
- // approximate error count: 3
- "PhanTypeInstantiateAbstract",
// approximate error count: 62
"PhanTypeInvalidDimOffset",
// approximate error count: 10
"PhanTypeMismatchForeach",
// approximate error count: 77
"PhanTypeMismatchProperty",
- // approximate error count: 88
+ // approximate error count: 85
"PhanTypeMismatchReturn",
- // approximate error count: 43
- "PhanTypeMissingReturn",
- // approximate error count: 1
- "PhanTypeNoAccessiblePropertiesForeach",
- // approximate error count: 4
- "PhanTypeNonVarPassByRef",
// approximate error count: 12
"PhanTypeObjectUnsetDeclaredProperty",
// approximate error count: 9
"PhanUndeclaredConstant",
// approximate error count: 3
"PhanUndeclaredInvokeInCallable",
- // approximate error count: 242
+ // approximate error count: 239
"PhanUndeclaredMethod",
// approximate error count: 847
"PhanUndeclaredProperty",
// $results if all are done.
unset( $targets[$placeholder] );
$placeholder = '{' . $placeholder . '}';
+ // @phan-suppress-next-line PhanTypeNoAccessiblePropertiesForeach
foreach ( $results[$target] as $value ) {
if ( !preg_match( '/^[^{}]*$/', $value ) ) {
// Skip values that make invalid parameter names.
* @return AuthenticationRequest
*/
public static function __set_state( $data ) {
+ // @phan-suppress-next-line PhanTypeInstantiateAbstract
$ret = new static();
foreach ( $data as $k => $v ) {
$ret->$k = $v;
* @inheritDoc
*/
public static function newFromRow( \stdClass $row ) {
+ // @phan-suppress-next-line PhanTypeInstantiateAbstract
return new static( $row->ir_ipb_id, $row->ir_value );
}
* HTML to build the textbox1 on edit conflicts
*
* @param array $customAttribs
- * @return string HTML
*/
public function getEditConflictMainTextBox( array $customAttribs = [] ) {
$builder = new TextboxBuilder();
}
$config['logger'] = LoggerFactory::getInstance( 'LockManager' );
+ // @phan-suppress-next-line PhanTypeInstantiateAbstract
$this->managers[$name]['instance'] = new $class( $config );
}
* @ingroup FileAbstraction
*/
+// @phan-file-suppress PhanTypeMissingReturn false positives
/**
* Implements some public methods and some protected utility functions which
* are required by multiple child classes. Contains stub functionality for
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\DBUnexpectedError;
+// @phan-file-suppress PhanTypeMissingReturn false positives
/**
* Foreign file with an accessible MediaWiki database
*
parent::applyPatch( $path, $isFullPath, $msg );
$this->db->scrollableCursor( $prevScroll );
$this->db->prepareStatements( $prevPrep );
+ return true;
}
/**
if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
$this->output( "...skipping: '$table' table doesn't exist yet.\n" );
- return;
+ return true;
}
// Second requirement: the new index must be missing
" $old should be manually removed if not needed anymore.\n" );
}
- return;
+ return true;
}
// Third requirement: the old index must exist
if ( !$this->db->indexExists( $table, $old, __METHOD__ ) ) {
$this->output( "...skipping: index $old doesn't exist.\n" );
- return;
+ return true;
}
$this->db->query( "ALTER INDEX $old RENAME TO $new" );
+ return true;
}
protected function dropPgField( $table, $field ) {
$this->parent->restoreLinkPopups();
$this->endForm( false, false );
+ return '';
}
}
$this->parent->output->addWikiTextAsInterface( $text );
$this->startForm();
$this->endForm( false );
+ return '';
}
/**
$firstBatch = false;
}
} while ( $idsToUpdate );
+ return true;
}
}
* Memcache initializer
*
* @param array $args Associative array of settings
- *
- * @return mixed
*/
public function __construct( $args ) {
$this->set_servers( $args['servers'] ?? array() );
return $params;
}
+ /**
+ * @suppress PhanTypeNonVarPassByRef
+ */
protected function doGet( $key, $flags = 0, &$casToken = null ) {
$this->debugLog( "get($key)" );
if ( defined( Memcached::class . '::GET_EXTENDED' ) ) { // v3.0.0
*
* @param callable $callback
* @param string $fname Caller name
- * @return mixed
* @since 1.28
*/
public function onTransactionResolution( callable $callback, $fname = __METHOD__ );
*
* @param callable $callback
* @param string $fname
- * @return mixed
* @since 1.20
* @deprecated Since 1.32
*/
*
* @param string $name Callback name
* @param callable|null $callback Use null to unset a listener
- * @return mixed
* @since 1.28
*/
public function setTransactionListener( $name, callable $callback = null );
* the aliases can be removed, and then the old X-named indexes dropped.
*
* @param string[] $aliases
- * @return mixed
* @since 1.31
*/
public function setIndexAliases( array $aliases );
* the aliases can be removed, and then the old X-named indexes dropped.
*
* @param string[] $aliases
- * @return mixed
* @since 1.31
*/
public function setIndexAliases( array $aliases );
* the aliases can be removed, and then the old X-named indexes dropped.
*
* @param string[] $aliases
- * @return mixed
* @since 1.31
*/
public function setIndexAliases( array $aliases );
* @return TitleArray|Title[]
*/
public function getForeignCategories() {
- $this->mPage->getForeignCategories();
+ return $this->mPage->getForeignCategories();
}
}
}
public function getFunctionStats() {
+ return [];
}
public function getOutput() {
+ return '';
}
public function close() {
public function send( array $feed, $line ) {
$transport = UDPTransport::newFromString( $feed['uri'] );
$transport->emit( $line );
+ return true;
}
}
* @throws MWException If a duplicate module registration is attempted
* @throws MWException If a module name contains illegal characters (pipes or commas)
* @throws MWException If something other than a ResourceLoaderModule is being registered
- * @return bool False if there were any errors, in which case one or more modules were
- * not registered
*/
public function register( $name, $info = null ) {
$moduleSkinStyles = $this->config->get( 'ResourceModuleSkinStyles' );
* @return $this
*/
public function setFlag( $flag, $unset = false ) {
+ return $this;
}
/**
* are shown closer to the bottom; weight defaults to 0. Negative weight is allowed.)
* Keep order if weights are equal.
* @param array &$formDescriptor
- * @return array
*/
protected static function sortFormDescriptorFields( array &$formDescriptor ) {
$i = 0;
// Gotta override this since it's abstract
function formatResult( $skin, $result ) {
+ return false;
}
/**
* Show a form for filtering namespace and username
*
* @param string|null $par
- * @return string
*/
public function execute( $par ) {
$this->setHeaders();
* Form to ask for target user name.
*
* @param string $name User name submitted.
- * @return string Form asking for user name.
*/
protected function userForm( $name ) {
$htmlForm = HTMLForm::factory( 'ooui', [
*
* @param string $title Value for context title field
* @param string $input Value for input textbox
- * @return string
*/
private function makeForm( $title, $input ) {
$fields = [
->setMethod( 'get' )
->prepareForm()
->displayForm( false );
+ return '';
}
protected function getSuggestionsForTypes() {
protected function preText() {
$this->getOutput()->addModules( 'mediawiki.special.pageLanguage' );
+ return parent::preText();
}
protected function getFormFields() {
*
* @param Revision $previousRev
* @param Revision $currentRev
- * @return string HTML
*/
function showDiff( $previousRev, $currentRev ) {
$diffContext = clone $this->getContext();
*/
public function show() {
$this->addUploadJS();
- parent::show();
+ return parent::show();
}
/**
. htmlspecialchars( $time )
. "</i><br />\n"
);
+ return '';
}
}
}
$this->output( "Populating page_props.pp_sortkey complete.\n" );
+ return true;
}
protected function getUpdateKey() {
function dispatch( /*...*/ ) {
$args = func_get_args();
$pipes = $this->replicaPipes;
- $numPipes = stream_select( $x = [], $pipes, $y = [], 3600 );
+ $x = [];
+ $y = [];
+ $numPipes = stream_select( $x, $pipes, $y, 3600 );
if ( !$numPipes ) {
$this->critical( "Error waiting to write to replica DBs. Aborting" );
exit( 1 );