config.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. 'build/.phan/stubs',
  20. '3rdparty',
  21. 'lib/composer',
  22. 'themes',
  23. 'lib/',
  24. 'apps/',
  25. 'core/',
  26. 'ocs/',
  27. 'ocs-provider/',
  28. 'settings/',
  29. 'tests/lib/Util/User',
  30. ],
  31. // A directory list that defines files that will be excluded
  32. // from static analysis, but whose class and method
  33. // information should be included.
  34. //
  35. // Generally, you'll want to include the directories for
  36. // third-party code (such as "vendor/") in this list.
  37. //
  38. // n.b.: If you'd like to parse but not analyze 3rd
  39. // party code, directories containing that code
  40. // should be added to the `directory_list` as
  41. // to `exclude_analysis_directory_list`.
  42. "exclude_analysis_directory_list" => [
  43. '3rdparty',
  44. 'lib/composer',
  45. 'apps/admin_audit/tests',
  46. 'apps/comments/tests',
  47. 'apps/dav/tests',
  48. 'apps/encryption/tests',
  49. 'apps/federatedfilesharing/tests',
  50. 'apps/federation/tests',
  51. 'apps/files/tests',
  52. 'apps/files_external/3rdparty',
  53. 'apps/files_external/tests',
  54. 'apps/files_sharing/tests',
  55. 'apps/files_trashbin/tests',
  56. 'apps/files_versions/tests',
  57. 'apps/lookup_server_connector/tests',
  58. 'apps/oauth2/tests',
  59. 'apps/provisioning_api/tests',
  60. 'apps/sharebymail/tests',
  61. 'apps/systemtags/tests',
  62. 'apps/testing/tests',
  63. 'apps/theming/tests',
  64. 'apps/twofactor_backupcodes/tests',
  65. 'apps/updatenotification/tests',
  66. 'apps/user_ldap/tests',
  67. 'apps/workflowengine/tests',
  68. ],
  69. // The number of processes to fork off during the analysis
  70. // phase.
  71. 'processes' => 10,
  72. // Backwards Compatibility Checking. This is slow
  73. // and expensive, but you should consider running
  74. // it before upgrading your version of PHP to a
  75. // new version that has backward compatibility
  76. // breaks.
  77. 'backward_compatibility_checks' => false,
  78. // Run a quick version of checks that takes less
  79. // time at the cost of not running as thorough
  80. // an analysis. You should consider setting this
  81. // to true only when you wish you had more issues
  82. // to fix in your code base.
  83. 'quick_mode' => true,
  84. // If enabled, check all methods that override a
  85. // parent method to make sure its signature is
  86. // compatible with the parent's. This check
  87. // can add quite a bit of time to the analysis.
  88. 'analyze_signature_compatibility' => false,
  89. // The minimum severity level to report on. This can be
  90. // set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
  91. // Issue::SEVERITY_CRITICAL. Setting it to only
  92. // critical issues is a good place to start on a big
  93. // sloppy mature code base.
  94. 'minimum_severity' => 10,
  95. // If true, missing properties will be created when
  96. // they are first seen. If false, we'll report an
  97. // error message if there is an attempt to write
  98. // to a class property that wasn't explicitly
  99. // defined.
  100. 'allow_missing_properties' => true,
  101. // Allow null to be cast as any type and for any
  102. // type to be cast to null. Setting this to false
  103. // will cut down on false positives.
  104. 'null_casts_as_any_type' => true,
  105. // Allow null to be cast as any array-like type (Requires 0.9.3+)
  106. // This is an incremental step in migrating away from null_casts_as_any_type.
  107. // If null_casts_as_any_type is true, this has no effect.
  108. 'null_casts_as_array' => false,
  109. // Allow any array-like type to be cast to null. (Requires 0.9.3+)
  110. // This is an incremental step in migrating away from null_casts_as_any_type.
  111. // If null_casts_as_any_type is true, this has no effect.
  112. 'array_casts_as_null' => false,
  113. // If enabled, scalars (int, float, bool, true, false, string, null)
  114. // are treated as if they can cast to each other.
  115. 'scalar_implicit_cast' => true,
  116. // If this has entries, scalars (int, float, bool, true, false, string, null)
  117. // are allowed to perform the casts listed.
  118. // E.g. ['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]
  119. // allows casting null to a string, but not vice versa.
  120. // (subset of scalar_implicit_cast)
  121. // (Requires 0.9.3+)
  122. 'scalar_implicit_partial' => [],
  123. // If true, seemingly undeclared variables in the global
  124. // scope will be ignored. This is useful for projects
  125. // with complicated cross-file globals that you have no
  126. // hope of fixing.
  127. 'ignore_undeclared_variables_in_global_scope' => true,
  128. // Add any issue types (such as 'PhanUndeclaredMethod')
  129. // to this black-list to inhibit them from being reported.
  130. 'suppress_issue_types' => [
  131. // 'PhanUndeclaredMethod',
  132. ],
  133. // If empty, no filter against issues types will be applied.
  134. // If this white-list is non-empty, only issues within the list
  135. // will be emitted by Phan.
  136. 'whitelist_issue_types' => [
  137. // 'PhanAccessMethodPrivate',
  138. ],
  139. // A list of plugin files to execute
  140. 'plugins' => [
  141. 'build/.phan/plugins/SqlInjectionCheckerPlugin.php',
  142. ],
  143. ];