// If this is set to `null`, Phan will first attempt to infer the value from
// the project's composer.json's `{"require": {"php": "version range"}}` if possible.
// If that could not be determined, then Phan assumes `target_php_version`.
'minimum_target_php_version'=>null,
// Default: true. If this is set to true,
// and `target_php_version` is newer than the version used to run Phan,
// Phan will act as though functions added in newer PHP versions exist.
//
// NOTE: Currently, this only affects `Closure::fromCallable()`
'pretend_newer_core_methods_exist'=>true,
// Make the tolerant-php-parser polyfill generate doc comments
// for all types of elements, even if php-ast wouldn't (for an older PHP version)
'polyfill_parse_all_element_doc_comments'=>true,
// A list of individual files to include in analysis
// with a path relative to the root directory of the
// project.
'file_list'=>[],
// 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'=>[],
// For internal use by Phan to quickly check for membership in directory_list.
'__directory_regex'=>null,
// Whether to enable debugging output to stderr
'debug_output'=>false,
// List of case-insensitive file extensions supported by Phan.
// (e.g. `['php', 'html', 'htm']`)
'analyzed_file_extensions'=>['php'],
// A regular expression to match files to be excluded
// from parsing and analysis and will not be read at all.
//
// This is useful for excluding groups of test or example
// directories/files, unanalyzable files, or files that
// can't be removed for whatever reason.
// (e.g. `'@Test\.php$@'`, or `'@vendor/.*/(tests|Tests)/@'`)
'exclude_file_regex'=>'',
// A list of 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'=>[],
// Enable this to enable checks of require/include statements referring to valid paths.
// The settings `include_paths` and `warn_about_relative_include_statement` affect the checks.
'enable_include_path_checks'=>false,
// A list of [include paths](https://secure.php.net/manual/en/ini.core.php#ini.include-path) to check when checking if `require_once`, `include`, etc. are pointing to valid files.
//
// To refer to the directory of the file being analyzed, use `'.'`
// To refer to the project root directory, use \Phan\Config::getProjectRootDirectory()
// This is ignored if `enable_include_path_checks` is not `true`.
'include_paths'=>['.'],
// Enable this to warn about the use of relative paths in `require_once`, `include`, etc.
// Relative paths are harder to reason about, and opcache may have issues with relative paths in edge cases.
//
// This is ignored if `enable_include_path_checks` is not `true`.
'warn_about_relative_include_statement'=>false,
// 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 well as
// to `exclude_analysis_directory_list`.
'exclude_analysis_directory_list'=>[],
// This is set internally by Phan based on exclude_analysis_directory_list
'__exclude_analysis_regex'=>null,
// A list of files that will be included in static analysis,
// **to the exclusion of others.**
//
// This typically should not get put in your Phan config file.
// It gets set by `--include-analysis-file-list`.
//
// Use `directory_list` and `file_list` instead to add files
// to be parsed and analyzed, and `exclude_*` to exclude files
// and folders from analysis.
'include_analysis_file_list'=>[],
// 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.
//
// If you are migrating from PHP 5 to PHP 7,
// you should also look into using
// [php7cc (no longer maintained)](https://github.com/sstalle/php7cc)
// and [php7mar](https://github.com/Alexia/php7mar),
// which have different backwards compatibility checks.
//
// If you are still using versions of php older than 5.6,
// `PHP53CompatibilityPlugin` may be worth looking into if you are not running
// syntax checks for php 5.3 through another method such as
// `InvokePHPNativeSyntaxCheckPlugin` (see .phan/plugins/README.md).
'backward_compatibility_checks'=>true,
// A set of fully qualified class-names for which
// a call to `parent::__construct()` is required.
'parent_constructor_required'=>[],
// If true, this runs a quick version of checks that takes less
// time at the cost of not running as thorough
// of an analysis. You should consider setting this
// to true only when you wish you had more **undiagnosed** issues
// to fix in your code base.
//
// In quick-mode the scanner doesn't rescan a function
// or a method's code block every time a call is seen.
// This means that the problem here won't be detected:
//
// ```php
// <?php
// function test($arg):int {
// return $arg;
// }
// test("abc");
// ```
//
// This would normally generate:
//
// ```
// test.php:3 PhanTypeMismatchReturn Returning type string but test() is declared to return int
// ```
//
// The initial scan of the function's code block has no
// type information for `$arg`. It isn't until we see
// the call and rescan `test()`'s code block that we can
// detect that it is actually returning the passed in
// `string` instead of an `int` as declared.
'quick_mode'=>false,
// The maximum recursion depth that can be reached when analyzing the code.
// This setting only takes effect when quick_mode is disabled.
// A higher limit will make the analysis more accurate, but could possibly
// make it harder to track the code bit where a detected issue originates.
// As long as this is kept relatively low, performance is usually not affected
// by changing this setting.
'maximum_recursion_depth'=>2,
// 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.
//
// This will also check if final methods are overridden, etc.
'analyze_signature_compatibility'=>true,
// Set this to true to allow contravariance in real parameter types of method overrides
// (Users may enable this if analyzing projects that support only php 7.2+)
//
// See [this note about PHP 7.2's new features](https://secure.php.net/manual/en/migration72.new-features.php#migration72.new-features.param-type-widening).
// This is false by default. (By default, Phan will warn if real parameter types are omitted in an override)
//
// If this is null, this will be inferred from `target_php_version`.
'allow_method_param_type_widening'=>null,
// Set this to true to make Phan guess that undocumented parameter types
// (for optional parameters) have the same type as default values
// (Instead of combining that type with `mixed`).
//
// E.g. `function my_method($x = 'val')` would make Phan infer that `$x` had a type of `string`, not `string|mixed`.
// Phan will not assume it knows specific types if the default value is `false` or `null`.
// Allow adding types to vague return types such as @return object, @return ?mixed in function/method/closure union types.
// Normally, Phan only adds inferred returned types when there is no `@return` type or real return type signature..
// This setting can be disabled on individual methods by adding `@phan-hardcode-return-type` to the doc comment.
//
// Disabled by default. This is more useful with `--analyze-twice`.
'allow_overriding_vague_return_types'=>false,
// When enabled, infer that the types of the properties of `$this` are equal to their default values at the start of `__construct()`.
// This will have some false positives due to Phan not checking for setters and initializing helpers.
// This does not affect inherited properties.
//
// Set to true to enable.
'infer_default_properties_in_construct'=>false,
// If enabled, inherit any missing phpdoc for types from
// the parent method if none is provided.
//
// NOTE: This step will only be performed if `analyze_signature_compatibility` is also enabled.
'inherit_phpdoc_types'=>true,
// 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.
'minimum_severity'=>Issue::SEVERITY_LOW,
// If enabled, 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.
'allow_missing_properties'=>false,
// If enabled, allow null to be cast as any array-like type.
//
// 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,
// If enabled, allow any array-like type to be cast to null.
// 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, null can be cast to any type and any
// type can be cast to null. Setting this to true
// will cut down on false positives.
'null_casts_as_any_type'=>false,
// If enabled, Phan will warn if **any** type in a method invocation's object
// is definitely not an object,
// or if **any** type in an invoked expression is not a callable.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_method_checking'=>false,
// If enabled, Phan will warn if **any** type in the argument's union type
// cannot be cast to a type in the parameter's expected union type.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_param_checking'=>false,
// If enabled, Phan will warn if **any** type in a property assignment's union type
// cannot be cast to a type in the property's declared union type.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_property_checking'=>false,
// If enabled, Phan will warn if **any** type in a returned value's union type
// cannot be cast to the declared return type.
// Setting this to true will introduce numerous false positives
// (and reveal some bugs).
'strict_return_checking'=>false,
// If enabled, Phan will warn if **any** type of the object expression for a property access
// does not contain that property.
'strict_object_checking'=>false,
// If enabled, Phan will act as though it's certain of real return types of a subset of internal functions,
// even if those return types aren't available in reflection (real types were taken from php 7.3 or 8.0-dev, depending on target_php_version).
//
// Note that with php 7 and earlier, php would return null or false for many internal functions if the argument types or counts were incorrect.
// As a result, enabling this setting with target_php_version 8.0 may result in false positives for `--redundant-condition-detection` when codebases also support php 7.x.
// then use a slower PHP substitute for php-ast to try to parse the files.
// This setting is ignored if a file is excluded from analysis.
//
// NOTE: it is strongly recommended to enable this via the `--use-fallback-parser` CLI flag instead,
// since this may result in strange error messages for invalid files (e.g. if parsed but not analyzed).
'use_fallback_parser'=>false,
// Use the polyfill parser based on tolerant-php-parser instead of the possibly missing native implementation
//
// NOTE: This makes parsing several times slower than the native implementation.
//
// NOTE: it is strongly recommended to enable this via the `--use-polyfill-parser` or `--force-polyfill-parser`
// since this may result in strange error messages for invalid files (e.g. if parsed but not analyzed).
'use_polyfill_parser'=>false,
// Keep a reference to the original tolerant-php-parser node in the generated php-ast Node.
// This is extremely memory intensive, and only recommended if a Phan plugin is used for code reformatting, style checks, etc.
'__parser_keep_original_node'=>false,
// Path to a Unix socket for a daemon to listen to files to analyze. Use command line option instead.
'daemonize_socket'=>false,
// If a daemon should listen to files to analyze over TCP.
// This setting is mutually exclusive with `daemonize_socket`.
'daemonize_tcp'=>false,
// TCP host for a daemon to listen to files to analyze.
'daemonize_tcp_host'=>'127.0.0.1',
// TCP port (from 1024 to 65535) for a daemon to listen to files to analyze.
'daemonize_tcp_port'=>4846,
// If this is an array, it configures the way clients will communicate with the Phan language server.
// Possibilities: Exactly one of
//
// 1. `['stdin' => true]`
// 2. `['tcp-server' => string (address this server should listen on)]`
// 3. `['tcp' => string (address client is listening on)]`
'language_server_config'=>false,
// Valid values: false, true. Should only be set via CLI (`--language-server-analyze-only-on-save`)
'language_server_analyze_only_on_save'=>false,
// Valid values: null, 'info'. Used when developing or debugging a language server client of Phan.
'language_server_debug_level'=>null,
// Set this to true to emit all issues detected from the language server (e.g. invalid phpdoc in parsed files),
// not just issues in files currently open in the editor/IDE.
// This can be very verbose and has more false positives.
'language_server_disable_output_filter'=>false,
// This should only be set by CLI (`--language-server-force-missing-pcntl` or `language-server-require-pcntl`), which will set this to true for debugging.
// When true, this will manually back up the state of the PHP process and restore it.
'language_server_use_pcntl_fallback'=>false,
// This should only be set via CLI (`--language-server-disable-go-to-definition` to disable)
// Affects "go to definition" and "go to type definition" of LSP.
'language_server_enable_go_to_definition'=>true,
// This should only be set via CLI (`--language-server-disable-hover` to disable)
// Affects "hover" of LSP.
'language_server_enable_hover'=>true,
// This should only be set via CLI (`--language-server-disable-completion` to disable)
// Affects "completion" of LSP.
'language_server_enable_completion'=>true,
// Don't show the category name in issue messages.
// This makes error messages slightly shorter.
// Use `--language-server-hide-category` if you want to enable this.
'language_server_hide_category_of_issues'=>false,
// Set this to false to disable the plugins that Phan uses to infer more accurate return types of `array_map`, `array_filter`, and many other functions.
//
// Phan is slightly faster when these are disabled.
'enable_internal_return_type_plugins'=>true,
// Set this to true to enable the plugins that Phan uses to infer more accurate return types of `implode`, `json_decode`, and many other functions.
//
// Phan is slightly faster when these are disabled.
// (The first type makes it easier to see uncommon issues when reading the code but is more prone to merge conflicts in version control)
// (Does not affect analysis)
'baseline_summary_type'=>'ordered_by_count',
// A list of plugin files to execute.
//
// Plugins which are bundled with Phan can be added here by providing their name (e.g. `'AlwaysReturnPlugin'`)
//
// Documentation about available bundled plugins can be found [here](https://github.com/phan/phan/tree/v5/.phan/plugins).
//
// Alternately, you can pass in the full path to a PHP file with the plugin's implementation (e.g. `'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php'`)
'plugins'=>[
],
// This can be used by third-party plugins that expect configuration.
//
// E.g. this is used by `InvokePHPNativeSyntaxCheckPlugin`
'plugin_config'=>[
],
// This should only be set with `--analyze-twice`.
'__analyze_twice'=>false,
// This should only be set with `--always-exit-successfully-after-analysis`