Skip to content

Commit

Permalink
Fix phan for 1.41 (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 26, 2024
1 parent 80d50e1 commit 9493289
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';

$cfg['suppress_issue_types'] = [
'PhanAccessMethodInternal',
'SecurityCheck-LikelyFalsePositive',
// Different versions of MediaWiki will need different suppressions.
'UnusedPluginSuppression'
];

return $cfg;
8 changes: 4 additions & 4 deletions includes/DataDumpPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function onGenerate( array $params ) {
Html::element(
'p',
[],
$this->msg( 'datadump-type-invalid' )->escaped()
$this->msg( 'datadump-type-invalid' )->text()
),
'mw-notify-error'
)
Expand Down Expand Up @@ -310,7 +310,7 @@ public function onGenerate( array $params ) {
Html::element(
'p',
[],
$this->msg( 'datadump-generated-success' )->escaped()
$this->msg( 'datadump-generated-success' )->text()
),
'mw-notify-success'
)
Expand All @@ -323,7 +323,7 @@ public function onGenerate( array $params ) {
Html::element(
'p',
[],
$this->msg( 'datadump-type-invalid' )->escaped()
$this->msg( 'datadump-type-invalid' )->text()
),
'mw-notify-error'
)
Expand Down Expand Up @@ -355,7 +355,7 @@ private function getGenerateLimit( string $type ) {
Html::element(
'p',
[],
$this->msg( 'datadump-generated-error', $limit )->escaped()
$this->msg( 'datadump-generated-error', $limit )->text()
),
'mw-notify-error'
)
Expand Down
8 changes: 1 addition & 7 deletions includes/api/ApiDeleteDumps.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ public function execute() {
$this->dieBlocked( $user->getBlock() );
}

// @phan-suppress-next-line PhanDeprecatedFunction Only for MW 1.39 or lower.
if ( $user->isBlockedGlobally() ) {
// @phan-suppress-next-line PhanDeprecatedFunction Only for MW 1.39 or lower.
$this->dieBlocked( $user->getGlobalBlock() );
}

$this->checkUserRightsAny( $perm, $user );
$this->checkUserRightsAny( $perm );

$this->doDelete( $type, $fileName );

Expand Down
8 changes: 1 addition & 7 deletions includes/api/ApiGenerateDumps.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ public function execute() {
$this->dieBlocked( $user->getBlock() );
}

// @phan-suppress-next-line PhanDeprecatedFunction Only for MW 1.39 or lower.
if ( $user->isBlockedGlobally() ) {
// @phan-suppress-next-line PhanDeprecatedFunction Only for MW 1.39 or lower.
$this->dieBlocked( $user->getGlobalBlock() );
}

$this->checkUserRightsAny( $perm, $user );
$this->checkUserRightsAny( $perm );

$this->doGenerate( $type );

Expand Down
6 changes: 3 additions & 3 deletions includes/specials/SpecialDataDump.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function doDelete( string $type, string $fileName ) {
Html::element(
'p',
[],
$this->msg( 'datadump-dump-does-not-exist', $fileName )->escaped()
$this->msg( 'datadump-dump-does-not-exist', $fileName )->text()
),
'mw-notify-error'
)
Expand All @@ -145,7 +145,7 @@ private function doDelete( string $type, string $fileName ) {
Html::element(
'p',
[],
$this->msg( 'datadump-delete-failed' )->escaped()
$this->msg( 'datadump-delete-failed' )->text()
),
'mw-notify-error'
)
Expand Down Expand Up @@ -179,7 +179,7 @@ private function onDeleteDump( $dbw, $fileName ) {
Html::element(
'p',
[],
$this->msg( 'datadump-delete-success' )->escaped()
$this->msg( 'datadump-delete-success' )->text()
),
'mw-notify-success'
)
Expand Down

0 comments on commit 9493289

Please sign in to comment.