config.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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/accessibility/composer',
  52. 'apps/admin_audit/composer',
  53. 'apps/admin_audit/tests',
  54. 'apps/cloud_federation_api/composer',
  55. 'apps/comments/composer',
  56. 'apps/comments/tests',
  57. 'apps/dav/composer',
  58. 'apps/dav/tests',
  59. 'apps/encryption/composer',
  60. 'apps/encryption/tests',
  61. 'apps/federatedfilesharing/composer',
  62. 'apps/federatedfilesharing/tests',
  63. 'apps/federation/composer',
  64. 'apps/federation/tests',
  65. 'apps/files/composer',
  66. 'apps/files/tests',
  67. 'apps/files_external/3rdparty',
  68. 'apps/files_external/composer',
  69. 'apps/files_external/tests',
  70. 'apps/files_sharing/composer',
  71. 'apps/files_sharing/tests',
  72. 'apps/files_trashbin/composer',
  73. 'apps/files_trashbin/tests',
  74. 'apps/files_versions/composer',
  75. 'apps/files_versions/tests',
  76. 'apps/lookup_server_connector/composer',
  77. 'apps/lookup_server_connector/tests',
  78. 'apps/oauth2/composer',
  79. 'apps/oauth2/tests',
  80. 'apps/provisioning_api/composer',
  81. 'apps/provisioning_api/tests',
  82. 'apps/sharebymail/composer',
  83. 'apps/sharebymail/tests',
  84. 'apps/systemtags/composer',
  85. 'apps/systemtags/tests',
  86. 'apps/testing/composer',
  87. 'apps/testing/tests',
  88. 'apps/theming/composer',
  89. 'apps/theming/tests',
  90. 'apps/twofactor_backupcodes/composer',
  91. 'apps/twofactor_backupcodes/tests',
  92. 'apps/updatenotification/composer',
  93. 'apps/updatenotification/tests',
  94. 'apps/user_ldap/composer',
  95. 'apps/user_ldap/tests',
  96. 'apps/workflowengine/composer',
  97. 'apps/workflowengine/tests',
  98. 'build/.phan/',
  99. 'lib/composer',
  100. ],
  101. // A file list that defines files that will be excluded
  102. // from parsing and analysis and will not be read at all.
  103. //
  104. // This is useful for excluding hopelessly unanalyzable
  105. // files that can't be removed for whatever reason.
  106. 'exclude_file_list' => [
  107. 'apps/encryption/appinfo/routes.php',
  108. 'apps/federation/appinfo/routes.php',
  109. 'apps/files/appinfo/routes.php',
  110. 'apps/files_external/appinfo/routes.php',
  111. 'apps/files_trashbin/appinfo/routes.php',
  112. 'apps/files_versions/appinfo/routes.php',
  113. 'apps/testing/appinfo/routes.php',
  114. 'apps/user_ldap/appinfo/routes.php',
  115. 'settings/routes.php',
  116. 'settings/ajax/updateapp.php',
  117. 'settings/ajax/uninstallapp.php',
  118. 'settings/ajax/togglesubadmins.php',
  119. 'settings/ajax/setquota.php',
  120. 'settings/ajax/enableapp.php',
  121. 'settings/ajax/disableapp.php',
  122. 'core/register_command.php',
  123. 'ocs/routes.php',
  124. 'ocs/v1.php',
  125. 'core/routes.php',
  126. ],
  127. // The number of processes to fork off during the analysis
  128. // phase.
  129. 'processes' => 5,
  130. // Backwards Compatibility Checking. This is slow
  131. // and expensive, but you should consider running
  132. // it before upgrading your version of PHP to a
  133. // new version that has backward compatibility
  134. // breaks.
  135. 'backward_compatibility_checks' => false,
  136. // Run a quick version of checks that takes less
  137. // time at the cost of not running as thorough
  138. // an analysis. You should consider setting this
  139. // to true only when you wish you had more issues
  140. // to fix in your code base.
  141. 'quick_mode' => false,
  142. // If true, check to make sure the return type declared
  143. // in the doc-block (if any) matches the return type
  144. // declared in the method signature. This process is
  145. // slow.
  146. 'check_docblock_signature_param_type_match' => true,
  147. // If enabled, check all methods that override a
  148. // parent method to make sure its signature is
  149. // compatible with the parent's. This check
  150. // can add quite a bit of time to the analysis.
  151. 'analyze_signature_compatibility' => true,
  152. // The minimum severity level to report on. This can be
  153. // set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
  154. // Issue::SEVERITY_CRITICAL. Setting it to only
  155. // critical issues is a good place to start on a big
  156. // sloppy mature code base.
  157. 'minimum_severity' => \Phan\Issue::SEVERITY_CRITICAL,
  158. // If true, missing properties will be created when
  159. // they are first seen. If false, we'll report an
  160. // error message if there is an attempt to write
  161. // to a class property that wasn't explicitly
  162. // defined.
  163. 'allow_missing_properties' => false,
  164. // Allow null to be cast as any type and for any
  165. // type to be cast to null. Setting this to false
  166. // will cut down on false positives.
  167. 'null_casts_as_any_type' => false,
  168. // Allow null to be cast as any array-like type (Requires 0.9.3+)
  169. // This is an incremental step in migrating away from null_casts_as_any_type.
  170. // If null_casts_as_any_type is true, this has no effect.
  171. 'null_casts_as_array' => false,
  172. // Allow any array-like type to be cast to null. (Requires 0.9.3+)
  173. // This is an incremental step in migrating away from null_casts_as_any_type.
  174. // If null_casts_as_any_type is true, this has no effect.
  175. 'array_casts_as_null' => false,
  176. // If enabled, scalars (int, float, bool, true, false, string, null)
  177. // are treated as if they can cast to each other.
  178. 'scalar_implicit_cast' => true,
  179. // If this has entries, scalars (int, float, bool, true, false, string, null)
  180. // are allowed to perform the casts listed.
  181. // E.g. ['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]
  182. // allows casting null to a string, but not vice versa.
  183. // (subset of scalar_implicit_cast)
  184. // (Requires 0.9.3+)
  185. 'scalar_implicit_partial' => [],
  186. // If true, seemingly undeclared variables in the global
  187. // scope will be ignored. This is useful for projects
  188. // with complicated cross-file globals that you have no
  189. // hope of fixing.
  190. 'ignore_undeclared_variables_in_global_scope' => true,
  191. // Add any issue types (such as 'PhanUndeclaredMethod')
  192. // to this black-list to inhibit them from being reported.
  193. 'suppress_issue_types' => [
  194. // 'PhanUndeclaredMethod',
  195. ],
  196. // If empty, no filter against issues types will be applied.
  197. // If this white-list is non-empty, only issues within the list
  198. // will be emitted by Phan.
  199. 'whitelist_issue_types' => [
  200. // 'PhanAccessMethodPrivate',
  201. ],
  202. // A list of plugin files to execute
  203. 'plugins' => [
  204. 'build/.phan/plugins/SqlInjectionCheckerPlugin.php',
  205. ],
  206. ];