config.php 7.3 KB

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