/**
* Get the name of the module as shown in the profiler log
*
- * @param $db DatabaseBase
+ * @param $db DatabaseBase|bool
*
* @return string
*/
* automated identification of the error, e.g., 'unknown_action'
* @param $httpRespCode int HTTP response code
* @param $extradata array Data to add to the "<error>" element; array in ApiResult format
+ * @throws UsageException
*/
public function dieUsage( $description, $errorCode, $httpRespCode = 0, $extradata = null ) {
Profiler::instance()->close();
class UsageException extends MWException {
private $mCodestr;
+
+ /**
+ * @var null|array
+ */
private $mExtraData;
+ /**
+ * @param $message string
+ * @param $codestr string
+ * @param $code int
+ * @param $extradata array|null
+ */
public function __construct( $message, $codestr, $code = 0, $extradata = null ) {
parent::__construct( $message, $code );
$this->mCodestr = $codestr;
/**
* Constructor
- * @param $query ApiQueryBase
+ * @param $query ApiBase
* @param $resolveRedirects bool Whether redirects should be resolved
* @param $convertTitles bool
*/
protected $mAllowedGenerators = array();
+ /**
+ * @param $main ApiMain
+ * @param $action string
+ */
public function __construct( $main, $action ) {
parent::__construct( $main, $action );
return null;
}
+ /**
+ * @return ApiFormatRaw|null
+ */
public function getCustomPrinter() {
// If &exportnowrap is set, use the raw formatter
if ( $this->getParameter( 'export' ) &&
$this->outputGeneralPageInfo();
// Execute all requested modules.
+ /**
+ * @var $module ApiQueryBase
+ */
foreach ( $modules as $module ) {
$params = $module->extractRequestParams();
$cacheMode = $this->mergeCacheMode(
*/
private function addCustomFldsToPageSet( $modules, $pageSet ) {
// Query all requested modules.
+ /**
+ * @var $module ApiQueryBase
+ */
foreach ( $modules as $module ) {
$module->requestExtraData( $pageSet );
}
// Show redirect information
$redirValues = array();
+ /**
+ * @var $titleTo Title
+ */
foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleTo ) {
$r = array(
'from' => strval( $titleStrFrom ),
private $mIsGenerator;
+ /**
+ * @param $query ApiBase
+ * @param $moduleName string
+ * @param $paramPrefix string
+ */
public function __construct( $query, $moduleName, $paramPrefix = '' ) {
parent::__construct( $query, $moduleName, $paramPrefix );
$this->mIsGenerator = false;