"PhanTypeArraySuspiciousNullable",
// approximate error count: 26
"PhanTypeComparisonFromArray",
- // approximate error count: 2
- "PhanTypeComparisonToArray",
// approximate error count: 63
"PhanTypeInvalidDimOffset",
- // approximate error count: 6
- "PhanTypeInvalidExpressionArrayDestructuring",
// approximate error count: 7
"PhanTypeInvalidLeftOperandOfIntegerOp",
// approximate error count: 2
* the name of the class defining the property, <component> is the MediaWiki component
* (extension, skin etc.) for use in the deprecation warning) or null if it is MediaWiki.
* E.g. [ 'mNewRev' => [ '1.32', 'DifferenceEngine', null ]
- * @var string[]
+ * @var string[][]
*/
protected $deprecatedPublicProperties = [];
public function set( $key, $value, $expire = 0, $flags = 0 ) {
$result = wincache_ucache_set( $key, serialize( $value ), $expire );
+ // false positive, wincache_ucache_set returns an empty array
+ // in some circumstances.
+ // @phan-suppress-next-line PhanTypeComparisonToArray
return ( $result === [] || $result === true );
}
public function add( $key, $value, $exptime = 0, $flags = 0 ) {
$result = wincache_ucache_add( $key, serialize( $value ), $exptime );
+ // false positive, wincache_ucache_add returns an empty array
+ // in some circumstances.
+ // @phan-suppress-next-line PhanTypeComparisonToArray
return ( $result === [] || $result === true );
}
}
}
- array_walk( $modules, [ 'self', 'trimArray' ] );
+ array_walk( $modules, [ self::class, 'trimArray' ] );
return Xml::encodeJsCall(
'mw.loader.register',
* @param User $user
* @param string $editToken Edit token
* @param Config|null $config optional for backwards compatibility
- * @return string|null Null on success or string on error
+ * @return null|string|array Null on success, string on error, or array on
+ * hook error
*/
public static function getPermissionsError( $user, $editToken, Config $config = null ) {
if ( $config === null ) {
// Set the user limit key
if ( $userLimit !== false ) {
+ // phan is confused because &can-bypass's value is a bool, so it assumes
+ // that $userLimit is also a bool here.
+ // @phan-suppress-next-line PhanTypeInvalidExpressionArrayDestructuring
list( $max, $period ) = $userLimit;
wfDebug( __METHOD__ . ": effective user limit: $max in {$period}s\n" );
$keys[$cache->makeKey( 'limiter', $action, 'user', $id )] = $userLimit;
$triggered = false;
foreach ( $keys as $key => $limit ) {
+ // phan is confused because &can-bypass's value is a bool, so it assumes
+ // that $userLimit is also a bool here.
+ // @phan-suppress-next-line PhanTypeInvalidExpressionArrayDestructuring
list( $max, $period ) = $limit;
$summary = "(limit $max in {$period}s)";
$count = $cache->get( $key );
}
} elseif ( $dispLen > $length && $dispLen > strlen( $ellipsis ) ) {
# String in fact does need truncation, the truncation point was OK.
+ // @phan-suppress-next-line PhanTypeInvalidExpressionArrayDestructuring
list( $ret, $openTags ) = $maybeState; // reload state
$ret = $this->removeBadCharLast( $ret ); // multi-byte char fix
$ret .= $ellipsis; // add ellipsis