diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2021-10-25 21:15:52 +0200 |
---|---|---|
committer | Krinkle <krinkle@fastmail.com> | 2022-03-21 18:25:07 +0000 |
commit | 1f71eccf6370c6e437092e4b24d4f4957cc47e84 (patch) | |
tree | f1f2feb09cfcef8d7cb1c7e9c5b4ab79cd12ca89 /includes/api/ApiComparePages.php | |
parent | 50938694e59f9928ea3a1e8a4144374034d43a2a (diff) | |
download | mediawikicore-1f71eccf6370c6e437092e4b24d4f4957cc47e84.tar.gz mediawikicore-1f71eccf6370c6e437092e4b24d4f4957cc47e84.zip |
phan: Disable null_casts_as_any_type setting
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
Diffstat (limited to 'includes/api/ApiComparePages.php')
-rw-r--r-- | includes/api/ApiComparePages.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 1b8974ada89d..b4ccad795778 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -455,6 +455,7 @@ class ApiComparePages extends ApiBase { // Deprecated 'fromsection'/'tosection' if ( isset( $params["{$prefix}section"] ) ) { $section = $params["{$prefix}section"]; + // @phan-suppress-next-line PhanTypeMismatchArgumentNullable T240141 $newRev = MutableRevisionRecord::newFromParentRevision( $rev ); $content = $rev->getContent( SlotRecord::MAIN, RevisionRecord::FOR_THIS_USER, $this->getUser() ); @@ -470,6 +471,7 @@ class ApiComparePages extends ApiBase { "nosuch{$prefix}section" ); } + // @phan-suppress-next-line PhanTypeMismatchArgumentNullable T240141 $newRev->setContent( SlotRecord::MAIN, $content ); } @@ -543,6 +545,7 @@ class ApiComparePages extends ApiBase { $popts = ParserOptions::newFromContext( $this->getContext() ); $content = $this->contentTransformer->preSaveTransform( $content, + // @phan-suppress-next-line PhanTypeMismatchArgumentNullable T240141 $title, $this->getUser(), $popts @@ -565,6 +568,7 @@ class ApiComparePages extends ApiBase { $this->dieWithError( [ 'apierror-sectionsnotsupported', $content->getModel() ] ); } try { + // @phan-suppress-next-line PhanTypeMismatchArgumentNullable T240141 $content = $oldContent->replaceSection( $section, $content, '' ); } catch ( TimeoutException $e ) { throw $e; @@ -589,6 +593,7 @@ class ApiComparePages extends ApiBase { } } + // @phan-suppress-next-line PhanTypeMismatchArgumentNullable T240141 $newRev->setContent( $role, $content ); } return [ $newRev, $rev, null ]; |