* Title: phan false positive
* McrUndoAction: fixed improper use of @param
* UploadSourceAdapter: fixed wrong type
* XmlTypeCheck: Use null so phan doesn't think we're trying to call the
function ''
* Database: phan false positive
* SpecialBlock: Use phan's advanced type documentation so phan knows
specifically what's being returned
* ChangesListSpecialPage: phan false positive
* BatchRowUpdate: Have default callback take a parameter so phan doesn't
think too many arguments are being passed
* MimeAnalyzer: left FIXME for relying on PHP 7.1 unpack() signature
* LanguageConverter: Specify types for $mTables since phan couldn't
determine it automatically
* preprocessorFuzzTest: Implement User::load() method signature
Change-Id: I08080ab636c5fe67ea6a4e14b2212d7523606e21
13 files changed:
"PhanCommentParamWithoutRealParam",
// approximate error count: 2
"PhanCompatibleNegativeStringOffset",
"PhanCommentParamWithoutRealParam",
// approximate error count: 2
"PhanCompatibleNegativeStringOffset",
- // approximate error count: 1
- "PhanEmptyFQSENInCallable",
- // approximate error count: 1
- "PhanInvalidCommentForDeclarationType",
- // approximate error count: 6
- "PhanNonClassMethodCall",
// approximate error count: 21
"PhanParamReqAfterOpt",
// approximate error count: 21
"PhanParamReqAfterOpt",
- // approximate error count: 27
+ // approximate error count: 26
"PhanParamSignatureMismatch",
// approximate error count: 4
"PhanParamSignatureMismatchInternal",
"PhanParamSignatureMismatch",
// approximate error count: 4
"PhanParamSignatureMismatchInternal",
- // approximate error count: 1
- "PhanParamSignatureRealMismatchTooFewParameters",
- // approximate error count: 1
- "PhanParamSuspiciousOrder",
// approximate error count: 127
"PhanParamTooMany",
// approximate error count: 2
// approximate error count: 127
"PhanParamTooMany",
// approximate error count: 2
- "PhanParamTooManyCallable",
- // approximate error count: 1
- "PhanParamTooManyInternal",
- // approximate error count: 2
"PhanPluginDuplicateExpressionBinaryOp",
// approximate error count: 2
"PhanTraitParentReference",
"PhanPluginDuplicateExpressionBinaryOp",
// approximate error count: 2
"PhanTraitParentReference",
- // approximate error count: 27
+ // approximate error count: 26
"PhanTypeArraySuspicious",
// approximate error count: 33
"PhanTypeArraySuspiciousNullable",
"PhanTypeArraySuspicious",
// approximate error count: 33
"PhanTypeArraySuspiciousNullable",
"PhanTypeInvalidRightOperandOfIntegerOp",
// approximate error count: 152
"PhanTypeMismatchArgument",
"PhanTypeInvalidRightOperandOfIntegerOp",
// approximate error count: 152
"PhanTypeMismatchArgument",
- // approximate error count: 28
+ // approximate error count: 27
"PhanTypeMismatchArgumentInternal",
// approximate error count: 1
"PhanTypeMismatchBitwiseBinaryOperands",
"PhanTypeMismatchArgumentInternal",
// approximate error count: 1
"PhanTypeMismatchBitwiseBinaryOperands",
"PhanTypeMismatchDimFetch",
// approximate error count: 10
"PhanTypeMismatchForeach",
"PhanTypeMismatchDimFetch",
// approximate error count: 10
"PhanTypeMismatchForeach",
- // approximate error count: 77
+ // approximate error count: 78
"PhanTypeMismatchProperty",
// approximate error count: 88
"PhanTypeMismatchReturn",
"PhanTypeMismatchProperty",
// approximate error count: 88
"PhanTypeMismatchReturn",
"PhanUndeclaredVariableAssignOp",
// approximate error count: 55
"PhanUndeclaredVariableDim",
"PhanUndeclaredVariableAssignOp",
// approximate error count: 55
"PhanUndeclaredVariableDim",
- // approximate error count: 4
+ // approximate error count: 3
"PhanUnextractableAnnotationElementName",
// approximate error count: 4
"PhanUnextractableAnnotationSuffix",
"PhanUnextractableAnnotationElementName",
// approximate error count: 4
"PhanUnextractableAnnotationSuffix",
// Allow unicode if a single high-bit character appears
$r0 = sprintf( '\x%02x', $ord0 );
$allowUnicode = true;
// Allow unicode if a single high-bit character appears
$r0 = sprintf( '\x%02x', $ord0 );
$allowUnicode = true;
+ // @phan-suppress-next-line PhanParamSuspiciousOrder false positive
} elseif ( strpos( '-\\[]^', $d0 ) !== false ) {
$r0 = '\\' . $d0;
} else {
} elseif ( strpos( '-\\[]^', $d0 ) !== false ) {
$r0 = '\\' . $d0;
} else {
protected $undo = 0, $undoafter = 0, $cur = 0;
protected $undo = 0, $undoafter = 0, $cur = 0;
- /** @param RevisionRecord|null */
+ /** @var RevisionRecord|null */
protected $curRev = null;
public function getName() {
protected $curRev = null;
public function getName() {
[ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
}
[ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
}
+ /**
+ * @inheritDoc
+ * @return OOUI\PanelLayout
+ */
protected function wrapFieldSetSection( $legend, $section, $attributes, $isRoot ) {
// to get a user visible effect, wrap the fieldset into a framed panel layout
$layout = new OOUI\PanelLayout( [
protected function wrapFieldSetSection( $legend, $section, $attributes, $isRoot ) {
// to get a user visible effect, wrap the fieldset into a framed panel layout
$layout = new OOUI\PanelLayout( [
/** @var array */
public static $sourceRegistrations = [];
/** @var array */
public static $sourceRegistrations = [];
+ /** @var ImportSource */
private $mSource;
/** @var string */
private $mSource;
/** @var string */
if ( $eocdrPos !== false ) {
$this->logger->info( __METHOD__ . ": ZIP signature present in $file\n" );
// Check if it really is a ZIP file, make sure the EOCDR is at the end (T40432)
if ( $eocdrPos !== false ) {
$this->logger->info( __METHOD__ . ": ZIP signature present in $file\n" );
// Check if it really is a ZIP file, make sure the EOCDR is at the end (T40432)
+ // FIXME: unpack()'s third argument was added in PHP 7.1
+ // @phan-suppress-next-line PhanParamTooManyInternal
$commentLength = unpack( "n", $tail, $eocdrPos + 20 )[0];
if ( $eocdrPos + 22 + $commentLength !== strlen( $tail ) ) {
$this->logger->info( __METHOD__ . ": ZIP EOCDR not at end. Not a ZIP file." );
$commentLength = unpack( "n", $tail, $eocdrPos + 20 )[0];
if ( $eocdrPos + 22 + $commentLength !== strlen( $tail ) ) {
$this->logger->info( __METHOD__ . ": ZIP EOCDR not at end. Not a ZIP file." );
* Additional parsing options
*/
private $parserOptions = [
* Additional parsing options
*/
private $parserOptions = [
- 'processing_instruction_handler' => '',
+ 'processing_instruction_handler' => null,
'external_dtd_handler' => '',
'dtd_handler' => '',
'require_safe_dtd' => true
'external_dtd_handler' => '',
'dtd_handler' => '',
'require_safe_dtd' => true
list( $phpCallback ) = $callback;
$this->clearFlag( self::DBO_TRX ); // make each query its own transaction
try {
list( $phpCallback ) = $callback;
$this->clearFlag( self::DBO_TRX ); // make each query its own transaction
try {
+ // @phan-suppress-next-line PhanParamTooManyCallable
call_user_func( $phpCallback, $trigger, $this );
} catch ( Exception $ex ) {
call_user_func( $this->errorLogger, $ex );
call_user_func( $phpCallback, $trigger, $this );
} catch ( Exception $ex ) {
call_user_func( $this->errorLogger, $ex );
$filterDefinition = $this->transformFilterDefinition( $filterDefinition );
}
$filterDefinition = $this->transformFilterDefinition( $filterDefinition );
}
+ // @phan-suppress-next-line PhanNonClassMethodCall
$this->registerFilterGroup( new $className( $groupDefinition ) );
}
}
$this->registerFilterGroup( new $className( $groupDefinition ) );
}
}
* the HTMLForm
* @param WebRequest|null $request Optionally try and get data from a request too
* @return array [ User|string|null, Block::TYPE_ constant|null ]
* the HTMLForm
* @param WebRequest|null $request Optionally try and get data from a request too
* @return array [ User|string|null, Block::TYPE_ constant|null ]
+ * @phan-return array{0:User|string|null,1:int|null}
*/
public static function getTargetAndType( $par, WebRequest $request = null ) {
$i = 0;
*/
public static function getTargetAndType( $par, WebRequest $request = null ) {
$i = 0;
$this->reader = $reader;
$this->writer = $writer;
$this->generator = $generator;
$this->reader = $reader;
$this->writer = $writer;
$this->generator = $generator;
- $this->output = function () {
+ $this->output = function ( $text ) {
public $mVariantFallbacks;
public $mVariantNames;
public $mTablesLoaded = false;
public $mVariantFallbacks;
public $mVariantNames;
public $mTablesLoaded = false;
+
+ /**
+ * @var ReplacementArray[]
+ * @phan-var array<string,ReplacementArray>
+ */
// 'bidirectional' 'unidirectional' 'disable' for each variant
public $mManualLevel;
// 'bidirectional' 'unidirectional' 'disable' for each variant
public $mManualLevel;
class PPFuzzUser extends User {
public $ppfz_test, $mDataLoaded;
class PPFuzzUser extends User {
public $ppfz_test, $mDataLoaded;
+ function load( $flags = null ) {
if ( $this->mDataLoaded ) {
return;
}
if ( $this->mDataLoaded ) {
return;
}