Fix PhanPluginDuplicateConditional* errors (#1)
authorKunal Mehta <legoktm@member.fsf.org>
Fri, 22 Mar 2019 00:21:22 +0000 (17:21 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sun, 24 Mar 2019 01:06:35 +0000 (18:06 -0700)
Change-Id: I61e4d4a60dda27f43debab71a9c02f14c1468311

.phan/config.php
includes/PHPVersionCheck.php
includes/libs/filebackend/FileBackend.php
includes/specials/pagers/ProtectedPagesPager.php

index 52d5d99..e4ba47f 100644 (file)
@@ -104,10 +104,6 @@ $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
        // approximate error count: 1
        "PhanParamTooManyInternal",
        // approximate error count: 2
-       "PhanPluginDuplicateConditionalNullCoalescing",
-       // approximate error count: 1
-       "PhanPluginDuplicateConditionalTernaryDuplication",
-       // approximate error count: 2
        "PhanPluginDuplicateExpressionBinaryOp",
        // approximate error count: 2
        "PhanTraitParentReference",
index cbe63a3..01d5f9d 100644 (file)
@@ -20,6 +20,7 @@
 
 // phpcs:disable Generic.Arrays.DisallowLongArraySyntax,PSR2.Classes.PropertyDeclaration,MediaWiki.Usage.DirUsage
 // phpcs:disable Squiz.Scope.MemberVarScope.Missing,Squiz.Scope.MethodScope.Missing
+// @phan-file-suppress PhanPluginDuplicateConditionalNullCoalescing
 /**
  * Check PHP Version, as well as for composer dependencies in entry points,
  * and display something vaguely comprehensible in the event of a totally
index 19373ea..7bc3045 100644 (file)
@@ -162,9 +162,8 @@ abstract class FileBackend implements LoggerAwareInterface {
         */
        public function __construct( array $config ) {
                $this->name = $config['name'];
-               $this->domainId = isset( $config['domainId'] )
-                       ? $config['domainId'] // e.g. "my_wiki-en_"
-                       : $config['wikiId']; // b/c alias
+               $this->domainId = $config['domainId'] // e.g. "my_wiki-en_"
+                       ?? $config['wikiId']; // b/c alias
                if ( !preg_match( '!^[a-zA-Z0-9-_]{1,255}$!', $this->name ) ) {
                        throw new InvalidArgumentException( "Backend name '{$this->name}' is invalid." );
                } elseif ( !is_string( $this->domainId ) ) {
index bc4202e..5583842 100644 (file)
@@ -49,7 +49,7 @@ class ProtectedPagesPager extends TablePager {
                LinkRenderer $linkRenderer
        ) {
                $this->mConds = $conds;
-               $this->type = ( $type ) ? $type : 'edit';
+               $this->type = $type ?: 'edit';
                $this->level = $level;
                $this->namespace = $namespace;
                $this->sizetype = $sizetype;