config.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <?php
  2. /**
  3. * This configuration will be read and overlaid on top of the
  4. * default configuration. Command line arguments will be applied
  5. * after this file is read.
  6. *
  7. * @see src/Phan/Config.php
  8. * See Config for all configurable options.
  9. */
  10. return [
  11. // A list of directories that should be parsed for class and
  12. // method information. After excluding the directories
  13. // defined in exclude_analysis_directory_list, the remaining
  14. // files will be statically analyzed for errors.
  15. //
  16. // Thus, both first-party and third-party code being used by
  17. // your application should be included in this list.
  18. 'directory_list' => [
  19. '3rdparty',
  20. 'apps/',
  21. 'build/.phan/stubs',
  22. 'core/',
  23. 'lib/',
  24. 'lib/composer',
  25. 'ocs-provider/',
  26. 'ocs/',
  27. 'settings/',
  28. 'tests/lib/Util/User',
  29. 'themes',
  30. ],
  31. 'file_list' => [
  32. 'index.php',
  33. 'public.php',
  34. 'remote.php',
  35. 'status.php',
  36. 'version.php',
  37. ],
  38. // A directory list that defines files that will be excluded
  39. // from static analysis, but whose class and method
  40. // information should be included.
  41. //
  42. // Generally, you'll want to include the directories for
  43. // third-party code (such as "vendor/") in this list.
  44. //
  45. // n.b.: If you'd like to parse but not analyze 3rd
  46. // party code, directories containing that code
  47. // should be added to the `directory_list` as
  48. // to `exclude_analysis_directory_list`.
  49. 'exclude_analysis_directory_list' => [
  50. '3rdparty',
  51. 'apps/admin_audit/composer',
  52. 'apps/admin_audit/tests',
  53. 'apps/comments/composer',
  54. 'apps/comments/tests',
  55. 'apps/dav/composer',
  56. 'apps/dav/tests',
  57. 'apps/encryption/composer',
  58. 'apps/encryption/tests',
  59. 'apps/federatedfilesharing/composer',
  60. 'apps/federatedfilesharing/tests',
  61. 'apps/federation/composer',
  62. 'apps/federation/tests',
  63. 'apps/files/composer',
  64. 'apps/files/tests',
  65. 'apps/files_external/3rdparty',
  66. 'apps/files_external/composer',
  67. 'apps/files_external/tests',
  68. 'apps/files_sharing/composer',
  69. 'apps/files_sharing/tests',
  70. 'apps/files_trashbin/composer',
  71. 'apps/files_trashbin/tests',
  72. 'apps/files_versions/composer',
  73. 'apps/files_versions/tests',
  74. 'apps/lookup_server_connector/composer',
  75. 'apps/lookup_server_connector/tests',
  76. 'apps/oauth2/composer',
  77. 'apps/oauth2/tests',
  78. 'apps/provisioning_api/composer',
  79. 'apps/provisioning_api/tests',
  80. 'apps/sharebymail/composer',
  81. 'apps/sharebymail/tests',
  82. 'apps/systemtags/composer',
  83. 'apps/systemtags/tests',
  84. 'apps/testing/composer',
  85. 'apps/testing/tests',
  86. 'apps/theming/composer',
  87. 'apps/theming/tests',
  88. 'apps/twofactor_backupcodes/composer',
  89. 'apps/twofactor_backupcodes/tests',
  90. 'apps/updatenotification/composer',
  91. 'apps/updatenotification/tests',
  92. 'apps/user_ldap/composer',
  93. 'apps/user_ldap/tests',
  94. 'apps/workflowengine/composer',
  95. 'apps/workflowengine/tests',
  96. 'build/.phan/',
  97. 'lib/composer',
  98. ],
  99. // A file list that defines files that will be excluded
  100. // from parsing and analysis and will not be read at all.
  101. //
  102. // This is useful for excluding hopelessly unanalyzable
  103. // files that can't be removed for whatever reason.
  104. 'exclude_file_list' => [
  105. 'apps/encryption/appinfo/routes.php',
  106. 'apps/federation/appinfo/routes.php',
  107. 'apps/files/appinfo/routes.php',
  108. 'apps/files_external/appinfo/routes.php',
  109. 'apps/files_trashbin/appinfo/routes.php',
  110. 'apps/files_versions/appinfo/routes.php',
  111. 'apps/testing/appinfo/routes.php',
  112. 'apps/user_ldap/appinfo/routes.php',
  113. 'settings/routes.php',
  114. 'settings/ajax/updateapp.php',
  115. 'settings/ajax/uninstallapp.php',
  116. 'settings/ajax/togglesubadmins.php',
  117. 'settings/ajax/setquota.php',
  118. 'settings/ajax/enableapp.php',
  119. 'settings/ajax/disableapp.php',
  120. 'core/register_command.php',
  121. 'ocs/routes.php',
  122. 'ocs/v1.php',
  123. 'core/routes.php',
  124. ],
  125. // The number of processes to fork off during the analysis
  126. // phase.
  127. 'processes' => 10,
  128. // Backwards Compatibility Checking. This is slow
  129. // and expensive, but you should consider running
  130. // it before upgrading your version of PHP to a
  131. // new version that has backward compatibility
  132. // breaks.
  133. 'backward_compatibility_checks' => false,
  134. // Run a quick version of checks that takes less
  135. // time at the cost of not running as thorough
  136. // an analysis. You should consider setting this
  137. // to true only when you wish you had more issues
  138. // to fix in your code base.
  139. 'quick_mode' => false,
  140. // If true, check to make sure the return type declared
  141. // in the doc-block (if any) matches the return type
  142. // declared in the method signature. This process is
  143. // slow.
  144. 'check_docblock_signature_param_type_match' => true,
  145. // If enabled, check all methods that override a
  146. // parent method to make sure its signature is
  147. // compatible with the parent's. This check
  148. // can add quite a bit of time to the analysis.
  149. 'analyze_signature_compatibility' => true,
  150. // The minimum severity level to report on. This can be
  151. // set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
  152. // Issue::SEVERITY_CRITICAL. Setting it to only
  153. // critical issues is a good place to start on a big
  154. // sloppy mature code base.
  155. 'minimum_severity' => \Phan\Issue::SEVERITY_CRITICAL,
  156. // If true, missing properties will be created when
  157. // they are first seen. If false, we'll report an
  158. // error message if there is an attempt to write
  159. // to a class property that wasn't explicitly
  160. // defined.
  161. 'allow_missing_properties' => false,
  162. // Allow null to be cast as any type and for any
  163. // type to be cast to null. Setting this to false
  164. // will cut down on false positives.
  165. 'null_casts_as_any_type' => false,
  166. // Allow null to be cast as any array-like type (Requires 0.9.3+)
  167. // This is an incremental step in migrating away from null_casts_as_any_type.
  168. // If null_casts_as_any_type is true, this has no effect.
  169. 'null_casts_as_array' => false,
  170. // Allow any array-like type to be cast to null. (Requires 0.9.3+)
  171. // This is an incremental step in migrating away from null_casts_as_any_type.
  172. // If null_casts_as_any_type is true, this has no effect.
  173. 'array_casts_as_null' => false,
  174. // If enabled, scalars (int, float, bool, true, false, string, null)
  175. // are treated as if they can cast to each other.
  176. 'scalar_implicit_cast' => true,
  177. // If this has entries, scalars (int, float, bool, true, false, string, null)
  178. // are allowed to perform the casts listed.
  179. // E.g. ['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]
  180. // allows casting null to a string, but not vice versa.
  181. // (subset of scalar_implicit_cast)
  182. // (Requires 0.9.3+)
  183. 'scalar_implicit_partial' => [],
  184. // If true, seemingly undeclared variables in the global
  185. // scope will be ignored. This is useful for projects
  186. // with complicated cross-file globals that you have no
  187. // hope of fixing.
  188. 'ignore_undeclared_variables_in_global_scope' => true,
  189. // Add any issue types (such as 'PhanUndeclaredMethod')
  190. // to this black-list to inhibit them from being reported.
  191. 'suppress_issue_types' => [
  192. // 'PhanUndeclaredMethod',
  193. ],
  194. // If empty, no filter against issues types will be applied.
  195. // If this white-list is non-empty, only issues within the list
  196. // will be emitted by Phan.
  197. 'whitelist_issue_types' => [
  198. // 'PhanAccessMethodPrivate',
  199. ],
  200. // A list of plugin files to execute
  201. 'plugins' => [
  202. 'build/.phan/plugins/SqlInjectionCheckerPlugin.php',
  203. ],
  204. ];