2017-07-18 21:38:40 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This configuration will be read and overlaid on top of the
|
|
|
|
* default configuration. Command line arguments will be applied
|
|
|
|
* after this file is read.
|
|
|
|
*
|
|
|
|
* @see src/Phan/Config.php
|
|
|
|
* See Config for all configurable options.
|
|
|
|
*/
|
|
|
|
return [
|
|
|
|
// A list of directories that should be parsed for class and
|
|
|
|
// method information. After excluding the directories
|
|
|
|
// defined in exclude_analysis_directory_list, the remaining
|
|
|
|
// files will be statically analyzed for errors.
|
|
|
|
//
|
|
|
|
// Thus, both first-party and third-party code being used by
|
|
|
|
// your application should be included in this list.
|
|
|
|
'directory_list' => [
|
|
|
|
'3rdparty',
|
|
|
|
'apps/',
|
2017-07-19 16:37:03 +03:00
|
|
|
'build/.phan/stubs',
|
2017-07-18 21:38:40 +03:00
|
|
|
'core/',
|
2017-07-19 16:37:03 +03:00
|
|
|
'lib/',
|
|
|
|
'lib/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'ocs-provider/',
|
2017-07-19 16:37:03 +03:00
|
|
|
'ocs/',
|
2017-07-18 21:38:40 +03:00
|
|
|
'settings/',
|
|
|
|
'tests/lib/Util/User',
|
2017-07-19 16:37:03 +03:00
|
|
|
'themes',
|
|
|
|
],
|
|
|
|
'file_list' => [
|
|
|
|
'index.php',
|
|
|
|
'public.php',
|
|
|
|
'remote.php',
|
|
|
|
'status.php',
|
|
|
|
'version.php',
|
2017-07-18 21:38:40 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
// A directory list that defines files that will be excluded
|
|
|
|
// from static analysis, but whose class and method
|
|
|
|
// information should be included.
|
|
|
|
//
|
|
|
|
// Generally, you'll want to include the directories for
|
|
|
|
// third-party code (such as "vendor/") in this list.
|
|
|
|
//
|
|
|
|
// n.b.: If you'd like to parse but not analyze 3rd
|
|
|
|
// party code, directories containing that code
|
|
|
|
// should be added to the `directory_list` as
|
|
|
|
// to `exclude_analysis_directory_list`.
|
2017-07-19 16:37:03 +03:00
|
|
|
'exclude_analysis_directory_list' => [
|
2017-07-18 21:38:40 +03:00
|
|
|
'3rdparty',
|
2019-06-25 23:16:21 +03:00
|
|
|
'apps/accessibility/composer',
|
2017-10-19 14:44:41 +03:00
|
|
|
'apps/admin_audit/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/admin_audit/tests',
|
2019-06-25 23:16:21 +03:00
|
|
|
'apps/cloud_federation_api/composer',
|
2017-10-19 14:46:32 +03:00
|
|
|
'apps/comments/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/comments/tests',
|
2017-10-19 14:48:21 +03:00
|
|
|
'apps/dav/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/dav/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/encryption/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/encryption/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/federatedfilesharing/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/federatedfilesharing/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/federation/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/federation/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/files/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/files/tests',
|
|
|
|
'apps/files_external/3rdparty',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/files_external/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/files_external/tests',
|
2017-10-17 23:01:01 +03:00
|
|
|
'apps/files_sharing/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/files_sharing/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/files_trashbin/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/files_trashbin/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/files_versions/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/files_versions/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/lookup_server_connector/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/lookup_server_connector/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/oauth2/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/oauth2/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/provisioning_api/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/provisioning_api/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/sharebymail/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/sharebymail/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/systemtags/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/systemtags/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/testing/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/testing/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/theming/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/theming/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/twofactor_backupcodes/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/twofactor_backupcodes/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/updatenotification/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/updatenotification/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/user_ldap/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/user_ldap/tests',
|
2017-10-23 22:16:01 +03:00
|
|
|
'apps/workflowengine/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
'apps/workflowengine/tests',
|
2017-07-19 16:37:03 +03:00
|
|
|
'build/.phan/',
|
|
|
|
'lib/composer',
|
2017-07-18 21:38:40 +03:00
|
|
|
],
|
|
|
|
|
2017-07-19 16:37:03 +03:00
|
|
|
// A file list that defines files that will be excluded
|
|
|
|
// from parsing and analysis and will not be read at all.
|
|
|
|
//
|
|
|
|
// This is useful for excluding hopelessly unanalyzable
|
|
|
|
// files that can't be removed for whatever reason.
|
|
|
|
'exclude_file_list' => [
|
|
|
|
'apps/encryption/appinfo/routes.php',
|
|
|
|
'apps/federation/appinfo/routes.php',
|
|
|
|
'apps/files/appinfo/routes.php',
|
|
|
|
'apps/files_external/appinfo/routes.php',
|
|
|
|
'apps/files_trashbin/appinfo/routes.php',
|
|
|
|
'apps/files_versions/appinfo/routes.php',
|
|
|
|
'apps/testing/appinfo/routes.php',
|
|
|
|
'apps/user_ldap/appinfo/routes.php',
|
|
|
|
'settings/routes.php',
|
|
|
|
'settings/ajax/updateapp.php',
|
|
|
|
'settings/ajax/uninstallapp.php',
|
|
|
|
'settings/ajax/togglesubadmins.php',
|
|
|
|
'settings/ajax/setquota.php',
|
|
|
|
'settings/ajax/enableapp.php',
|
|
|
|
'settings/ajax/disableapp.php',
|
|
|
|
'core/register_command.php',
|
|
|
|
'ocs/routes.php',
|
|
|
|
'ocs/v1.php',
|
|
|
|
'core/routes.php',
|
|
|
|
],
|
|
|
|
|
|
|
|
|
2017-07-18 21:38:40 +03:00
|
|
|
// The number of processes to fork off during the analysis
|
|
|
|
// phase.
|
2019-04-09 23:04:31 +03:00
|
|
|
'processes' => 5,
|
2017-07-18 21:38:40 +03:00
|
|
|
|
|
|
|
// Backwards Compatibility Checking. This is slow
|
|
|
|
// and expensive, but you should consider running
|
|
|
|
// it before upgrading your version of PHP to a
|
|
|
|
// new version that has backward compatibility
|
|
|
|
// breaks.
|
|
|
|
'backward_compatibility_checks' => false,
|
|
|
|
|
|
|
|
// Run a quick version of checks that takes less
|
|
|
|
// time at the cost of not running as thorough
|
|
|
|
// an analysis. You should consider setting this
|
|
|
|
// to true only when you wish you had more issues
|
|
|
|
// to fix in your code base.
|
2017-11-27 09:53:56 +03:00
|
|
|
'quick_mode' => false,
|
2017-07-18 21:38:40 +03:00
|
|
|
|
2018-04-26 15:35:24 +03:00
|
|
|
// If true, check to make sure the return type declared
|
|
|
|
// in the doc-block (if any) matches the return type
|
|
|
|
// declared in the method signature. This process is
|
|
|
|
// slow.
|
|
|
|
'check_docblock_signature_param_type_match' => true,
|
|
|
|
|
2017-07-18 21:38:40 +03:00
|
|
|
// If enabled, check all methods that override a
|
|
|
|
// parent method to make sure its signature is
|
|
|
|
// compatible with the parent's. This check
|
|
|
|
// can add quite a bit of time to the analysis.
|
2017-11-27 09:53:56 +03:00
|
|
|
'analyze_signature_compatibility' => true,
|
2017-07-18 21:38:40 +03:00
|
|
|
|
|
|
|
// The minimum severity level to report on. This can be
|
|
|
|
// set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
|
|
|
|
// Issue::SEVERITY_CRITICAL. Setting it to only
|
|
|
|
// critical issues is a good place to start on a big
|
|
|
|
// sloppy mature code base.
|
2017-11-27 09:53:56 +03:00
|
|
|
'minimum_severity' => \Phan\Issue::SEVERITY_CRITICAL,
|
2017-07-18 21:38:40 +03:00
|
|
|
|
|
|
|
// If true, missing properties will be created when
|
|
|
|
// they are first seen. If false, we'll report an
|
|
|
|
// error message if there is an attempt to write
|
|
|
|
// to a class property that wasn't explicitly
|
|
|
|
// defined.
|
2017-11-27 09:53:56 +03:00
|
|
|
'allow_missing_properties' => false,
|
2017-07-18 21:38:40 +03:00
|
|
|
|
|
|
|
// Allow null to be cast as any type and for any
|
|
|
|
// type to be cast to null. Setting this to false
|
|
|
|
// will cut down on false positives.
|
2017-11-27 09:53:56 +03:00
|
|
|
'null_casts_as_any_type' => false,
|
2017-07-18 21:38:40 +03:00
|
|
|
|
|
|
|
// Allow null to be cast as any array-like type (Requires 0.9.3+)
|
|
|
|
// This is an incremental step in migrating away from null_casts_as_any_type.
|
|
|
|
// If null_casts_as_any_type is true, this has no effect.
|
|
|
|
'null_casts_as_array' => false,
|
|
|
|
|
|
|
|
// Allow any array-like type to be cast to null. (Requires 0.9.3+)
|
|
|
|
// This is an incremental step in migrating away from null_casts_as_any_type.
|
|
|
|
// If null_casts_as_any_type is true, this has no effect.
|
|
|
|
'array_casts_as_null' => false,
|
|
|
|
|
|
|
|
// If enabled, scalars (int, float, bool, true, false, string, null)
|
|
|
|
// are treated as if they can cast to each other.
|
|
|
|
'scalar_implicit_cast' => true,
|
|
|
|
|
|
|
|
// If this has entries, scalars (int, float, bool, true, false, string, null)
|
|
|
|
// are allowed to perform the casts listed.
|
|
|
|
// E.g. ['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]
|
|
|
|
// allows casting null to a string, but not vice versa.
|
|
|
|
// (subset of scalar_implicit_cast)
|
|
|
|
// (Requires 0.9.3+)
|
|
|
|
'scalar_implicit_partial' => [],
|
|
|
|
|
|
|
|
// If true, seemingly undeclared variables in the global
|
|
|
|
// scope will be ignored. This is useful for projects
|
|
|
|
// with complicated cross-file globals that you have no
|
|
|
|
// hope of fixing.
|
|
|
|
'ignore_undeclared_variables_in_global_scope' => true,
|
|
|
|
|
|
|
|
// Add any issue types (such as 'PhanUndeclaredMethod')
|
|
|
|
// to this black-list to inhibit them from being reported.
|
|
|
|
'suppress_issue_types' => [
|
|
|
|
// 'PhanUndeclaredMethod',
|
|
|
|
],
|
|
|
|
|
|
|
|
// If empty, no filter against issues types will be applied.
|
|
|
|
// If this white-list is non-empty, only issues within the list
|
|
|
|
// will be emitted by Phan.
|
|
|
|
'whitelist_issue_types' => [
|
|
|
|
// 'PhanAccessMethodPrivate',
|
|
|
|
],
|
2017-07-20 23:48:13 +03:00
|
|
|
|
|
|
|
// A list of plugin files to execute
|
|
|
|
'plugins' => [
|
|
|
|
'build/.phan/plugins/SqlInjectionCheckerPlugin.php',
|
|
|
|
],
|
2017-07-18 21:38:40 +03:00
|
|
|
];
|