|
| 1 | +<?php |
| 2 | + |
| 3 | +use \Phan\Issue; |
| 4 | + |
| 5 | +/** |
| 6 | + * This configuration will be read and overlayed on top of the |
| 7 | + * default configuration. Command line arguments will be applied |
| 8 | + * after this file is read. |
| 9 | + * |
| 10 | + * @see src/Phan/Config.php |
| 11 | + * See Config for all configurable options. |
| 12 | + * |
| 13 | + * A Note About Paths |
| 14 | + * ================== |
| 15 | + * |
| 16 | + * Files referenced from this file should be defined as |
| 17 | + * |
| 18 | + * ``` |
| 19 | + * Config::projectPath('relative_path/to/file') |
| 20 | + * ``` |
| 21 | + * |
| 22 | + * where the relative path is relative to the root of the |
| 23 | + * project which is defined as either the working directory |
| 24 | + * of the phan executable or a path passed in via the CLI |
| 25 | + * '-d' flag. |
| 26 | + */ |
| 27 | +return [ |
| 28 | + |
| 29 | + // If true, missing properties will be created when |
| 30 | + // they are first seen. If false, we'll report an |
| 31 | + // error message. |
| 32 | + "allow_missing_properties" => false, |
| 33 | + |
| 34 | + // Allow null to be cast as any type and for any |
| 35 | + // type to be cast to null. |
| 36 | + "null_casts_as_any_type" => false, |
| 37 | + |
| 38 | + // If enabled, scalars (int, float, bool, string, null) |
| 39 | + // are treated as if they can cast to each other. |
| 40 | + 'scalar_implicit_cast' => false, |
| 41 | + |
| 42 | + // If true, seemingly undeclared variables in the global |
| 43 | + // scope will be ignored. This is useful for projects |
| 44 | + // with complicated cross-file globals that you have no |
| 45 | + // hope of fixing. |
| 46 | + 'ignore_undeclared_variables_in_global_scope' => false, |
| 47 | + |
| 48 | + // Backwards Compatibility Checking |
| 49 | + 'backward_compatibility_checks' => false, |
| 50 | + |
| 51 | + // If enabled, check all methods that override a |
| 52 | + // parent method to make sure its signature is |
| 53 | + // compatible with the parent's. This check |
| 54 | + // can add quite a bit of time to the analysis. |
| 55 | + 'analyze_signature_compatibility' => true, |
| 56 | + |
| 57 | + // Set to true in order to attempt to detect dead |
| 58 | + // (unreferenced) code. Keep in mind that the |
| 59 | + // results will only be a guess given that classes, |
| 60 | + // properties, constants and methods can be referenced |
| 61 | + // as variables (like `$class->$property` or |
| 62 | + // `$class->$method()`) in ways that we're unable |
| 63 | + // to make sense of. |
| 64 | + 'dead_code_detection' => false, |
| 65 | + |
| 66 | + // Run a quick version of checks that takes less |
| 67 | + // time |
| 68 | + "quick_mode" => false, |
| 69 | + |
| 70 | + // Enable or disable support for generic templated |
| 71 | + // class types. |
| 72 | + 'generic_types_enabled' => true, |
| 73 | + |
| 74 | + // By default, Phan will not analyze all node types |
| 75 | + // in order to save time. If this config is set to true, |
| 76 | + // Phan will dig deeper into the AST tree and do an |
| 77 | + // analysis on all nodes, possibly finding more issues. |
| 78 | + // |
| 79 | + // See \Phan\Analysis::shouldVisit for the set of skipped |
| 80 | + // nodes. |
| 81 | + 'should_visit_all_nodes' => true, |
| 82 | + |
| 83 | + 'runkit_superglobals' => ['_DATE', '_RK'], |
| 84 | + |
| 85 | + 'globals_type_map' => [ |
| 86 | + '_DATE' => '\\DateTime', |
| 87 | + '_RK' => '\\RunkitGlobal', |
| 88 | + ], |
| 89 | + |
| 90 | + // The minimum severity level to report on. This can be |
| 91 | + // set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or |
| 92 | + // Issue::SEVERITY_CRITICAL. |
| 93 | + 'minimum_severity' => Issue::SEVERITY_LOW, |
| 94 | + |
| 95 | + // Add any issue types (such as 'PhanUndeclaredMethod') |
| 96 | + // here to inhibit them from being reported |
| 97 | + 'suppress_issue_types' => [ |
| 98 | + // 'PhanUndeclaredMethod', |
| 99 | + ], |
| 100 | + |
| 101 | + // If empty, no filter against issues types will be applied. |
| 102 | + // If non-empty, only issues within the list will be emitted |
| 103 | + // by Phan. |
| 104 | + 'whitelist_issue_types' => [ |
| 105 | + // 'PhanAccessMethodPrivate', |
| 106 | + // 'PhanAccessMethodProtected', |
| 107 | + // 'PhanAccessNonStaticToStatic', |
| 108 | + // 'PhanAccessPropertyPrivate', |
| 109 | + // 'PhanAccessPropertyProtected', |
| 110 | + // 'PhanAccessSignatureMismatch', |
| 111 | + // 'PhanAccessSignatureMismatchInternal', |
| 112 | + // 'PhanAccessStaticToNonStatic', |
| 113 | + // 'PhanCompatibleExpressionPHP7', |
| 114 | + // 'PhanCompatiblePHP7', |
| 115 | + // 'PhanContextNotObject', |
| 116 | + // 'PhanDeprecatedClass', |
| 117 | + // 'PhanDeprecatedFunction', |
| 118 | + // 'PhanDeprecatedProperty', |
| 119 | + // 'PhanEmptyFile', |
| 120 | + // 'PhanNonClassMethodCall', |
| 121 | + // 'PhanNoopArray', |
| 122 | + // 'PhanNoopClosure', |
| 123 | + // 'PhanNoopConstant', |
| 124 | + // 'PhanNoopProperty', |
| 125 | + // 'PhanNoopVariable', |
| 126 | + // 'PhanParamRedefined', |
| 127 | + // 'PhanParamReqAfterOpt', |
| 128 | + // 'PhanParamSignatureMismatch', |
| 129 | + // 'PhanParamSignatureMismatchInternal', |
| 130 | + // 'PhanParamSpecial1', |
| 131 | + // 'PhanParamSpecial2', |
| 132 | + // 'PhanParamSpecial3', |
| 133 | + // 'PhanParamSpecial4', |
| 134 | + // 'PhanParamTooFew', |
| 135 | + // 'PhanParamTooFewInternal', |
| 136 | + // 'PhanParamTooMany', |
| 137 | + // 'PhanParamTooManyInternal', |
| 138 | + // 'PhanParamTypeMismatch', |
| 139 | + // 'PhanParentlessClass', |
| 140 | + // 'PhanRedefineClass', |
| 141 | + // 'PhanRedefineClassInternal', |
| 142 | + // 'PhanRedefineFunction', |
| 143 | + // 'PhanRedefineFunctionInternal', |
| 144 | + // 'PhanStaticCallToNonStatic', |
| 145 | + // 'PhanSyntaxError', |
| 146 | + // 'PhanTraitParentReference', |
| 147 | + // 'PhanTypeArrayOperator', |
| 148 | + // 'PhanTypeArraySuspicious', |
| 149 | + // 'PhanTypeComparisonFromArray', |
| 150 | + // 'PhanTypeComparisonToArray', |
| 151 | + // 'PhanTypeConversionFromArray', |
| 152 | + // 'PhanTypeInstantiateAbstract', |
| 153 | + // 'PhanTypeInstantiateInterface', |
| 154 | + // 'PhanTypeInvalidLeftOperand', |
| 155 | + // 'PhanTypeInvalidRightOperand', |
| 156 | + // 'PhanTypeMismatchArgument', |
| 157 | + // 'PhanTypeMismatchArgumentInternal', |
| 158 | + // 'PhanTypeMismatchDefault', |
| 159 | + // 'PhanTypeMismatchForeach', |
| 160 | + // 'PhanTypeMismatchProperty', |
| 161 | + // 'PhanTypeMismatchReturn', |
| 162 | + // 'PhanTypeMissingReturn', |
| 163 | + // 'PhanTypeNonVarPassByRef', |
| 164 | + // 'PhanTypeParentConstructorCalled', |
| 165 | + // 'PhanTypeVoidAssignment', |
| 166 | + // 'PhanUnanalyzable', |
| 167 | + // 'PhanUndeclaredClass', |
| 168 | + // 'PhanUndeclaredClassCatch', |
| 169 | + // 'PhanUndeclaredClassConstant', |
| 170 | + // 'PhanUndeclaredClassInstanceof', |
| 171 | + // 'PhanUndeclaredClassMethod', |
| 172 | + // 'PhanUndeclaredClassReference', |
| 173 | + // 'PhanUndeclaredConstant', |
| 174 | + // 'PhanUndeclaredExtendedClass', |
| 175 | + // 'PhanUndeclaredFunction', |
| 176 | + // 'PhanUndeclaredInterface', |
| 177 | + // 'PhanUndeclaredMethod', |
| 178 | + // 'PhanUndeclaredProperty', |
| 179 | + // 'PhanUndeclaredStaticMethod', |
| 180 | + // 'PhanUndeclaredStaticProperty', |
| 181 | + // 'PhanUndeclaredTrait', |
| 182 | + // 'PhanUndeclaredTypeParameter', |
| 183 | + // 'PhanUndeclaredTypeProperty', |
| 184 | + // 'PhanUndeclaredVariable', |
| 185 | + // 'PhanUnreferencedClass', |
| 186 | + // 'PhanUnreferencedConstant', |
| 187 | + // 'PhanUnreferencedMethod', |
| 188 | + // 'PhanUnreferencedProperty', |
| 189 | + // 'PhanVariableUseClause', |
| 190 | + ], |
| 191 | + |
| 192 | + // A list of files to include in analysis |
| 193 | + 'file_list' => [ |
| 194 | + // 'vendor/phpunit/phpunit/src/Framework/TestCase.php', |
| 195 | + ], |
| 196 | + |
| 197 | + // A file list that defines files that will be excluded |
| 198 | + // from parsing and analysis and will not be read at all. |
| 199 | + // |
| 200 | + // This is useful for excluding hopelessly unanalyzable |
| 201 | + // files that can't be removed for whatever reason. |
| 202 | + 'exclude_file_list' => [], |
| 203 | + |
| 204 | + // The number of processes to fork off during the analysis |
| 205 | + // phase. |
| 206 | + 'processes' => 1, |
| 207 | + |
| 208 | + // A list of directories that should be parsed for class and |
| 209 | + // method information. After excluding the directories |
| 210 | + // defined in exclude_analysis_directory_list, the remaining |
| 211 | + // files will be statically analyzed for errors. |
| 212 | + // |
| 213 | + // Thus, both first-party and third-party code being used by |
| 214 | + // your application should be included in this list. |
| 215 | + 'directory_list' => [ |
| 216 | + 'src', |
| 217 | + 'vendor/nikic/php-parser/lib', |
| 218 | + ], |
| 219 | + |
| 220 | + // A directory list that defines files that will be excluded |
| 221 | + // from static analysis, but whose class and method |
| 222 | + // information should be included. |
| 223 | + // |
| 224 | + // Generally, you'll want to include the directories for |
| 225 | + // third-party code (such as "vendor/") in this list. |
| 226 | + // |
| 227 | + // n.b.: If you'd like to parse but not analyze 3rd |
| 228 | + // party code, directories containing that code |
| 229 | + // should be added to the `directory_list` as |
| 230 | + // to `exclude_analysis_directory_list`. |
| 231 | + "exclude_analysis_directory_list" => [ |
| 232 | + 'vendor/nikic/php-parser/lib', |
| 233 | + ], |
| 234 | + |
| 235 | + // A list of plugin files to execute |
| 236 | + 'plugins' => [ |
| 237 | + // NOTE: src/Phan/Language/Internal/FunctionSignatureMap.php mixes value without key as return type with values having keys deliberately. |
| 238 | + 'vendor/etsy/phan/.phan/plugins/AlwaysReturnPlugin.php', // (TODO: make BlockExitStatus more reliable) |
| 239 | + 'vendor/etsy/phan/.phan/plugins/DollarDollarPlugin.php', |
| 240 | + 'vendor/etsy/phan/.phan/plugins/DuplicateArrayKeyPlugin.php', |
| 241 | + 'vendor/etsy/phan/.phan/plugins/UnreachableCodePlugin.php', // (TODO: make BlockExitStatus more reliable) |
| 242 | + // NOTE: This plugin only produces correct results when |
| 243 | + // Phan is run on a single core (-j1). |
| 244 | + // '.phan/plugins/UnusedSuppressionPlugin.php', |
| 245 | + ], |
| 246 | + |
| 247 | +]; |
0 commit comments