Merge "Enable "PhanTypeInvalidRightOperand" phan checks"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 18 May 2018 09:13:24 +0000 (09:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 18 May 2018 09:13:24 +0000 (09:13 +0000)
includes/htmlform/HTMLFormField.php
includes/libs/ReplacementArray.php
tests/phan/config.php

index aab8811..5066f28 100644 (file)
@@ -17,6 +17,9 @@ abstract class HTMLFormField {
        protected $mVFormClass = '';
        protected $mHelpClass = false;
        protected $mDefault;
+       /**
+        * @var array|bool|null
+        */
        protected $mOptions = false;
        protected $mOptionsLabelsNotFromMessage = false;
        protected $mHideIf = null;
index 4512a4b..46f9358 100644 (file)
  * Wrapper around strtr() that holds replacements
  */
 class ReplacementArray {
-       private $data = false;
+       private $data = [];
 
        /**
         * Create an object with the specified replacement array
         * The array should have the same form as the replacement array for strtr()
         * @param array $data
         */
-       public function __construct( $data = [] ) {
+       public function __construct( array $data = [] ) {
                $this->data = $data;
        }
 
@@ -44,12 +44,12 @@ class ReplacementArray {
         * Set the whole replacement array at once
         * @param array $data
         */
-       public function setArray( $data ) {
+       public function setArray( array $data ) {
                $this->data = $data;
        }
 
        /**
-        * @return array|bool
+        * @return array
         */
        public function getArray() {
                return $this->data;
index bebdd3d..d9ce429 100644 (file)
@@ -329,8 +329,6 @@ return [
                "PhanTypeComparisonFromArray",
                // approximate error count: 2
                "PhanTypeComparisonToArray",
-               // approximate error count: 3
-               "PhanTypeInvalidRightOperand",
                // approximate error count: 1
                "PhanTypeMagicVoidWithReturn",
                // approximate error count: 218