Documentation

Config
in package

FinalYes
Tags
psalm-suppress

PropertyNotSetInConstructor

psalm-consistent-constructor

Table of Contents

Constants

CONFIG_NAMESPACE  = 'https://getpsalm.org/schema/config'
DEFAULT_BASELINE_NAME  = 'psalm-baseline.xml'
REPORT_ERROR  = 'error'
REPORT_INFO  = 'info'
REPORT_SUPPRESS  = 'suppress'
DEFAULT_FILE_NAMES  = ['psalm.xml', 'psalm.xml.dist', 'psalm.dist.xml']
MIXED_ISSUES  = ['MixedArgument', 'MixedArrayAccess', 'MixedArrayAssignment', 'MixedArrayOffset', 'MixedArrayTypeCoercion', 'MixedAssignment', 'MixedFunctionCall', 'MixedMethodCall', 'MixedOperand', 'MixedPropertyFetch', 'MixedPropertyAssignment', 'MixedReturnStatement', 'MixedStringOffsetAssignment', 'MixedArgumentTypeCoercion', 'MixedPropertyTypeCoercion', 'MixedReturnTypeCoercion']

Properties

$add_param_default_to_docblock_type  : bool
$all_constants_global  : bool
$all_functions_global  : bool
$allow_includes  : bool
$allow_internal_named_arg_calls  : bool
$allow_named_arg_calls  : bool
$allow_string_standin_for_class  : bool
$autoloader  : string|null
Path to the autoader
$base_dir  : string
The base directory of this config file without trailing slash
$check_for_throws_docblock  : bool
$check_for_throws_in_global_scope  : bool
$compressor  : "lz4"|"deflate"|"off"
$config_issues  : array<int, ConfigIssue>
$config_warnings  : array<int, string>
$debug_emitted_issues  : bool
$disable_suppress_all  : bool
$disable_var_parsing  : bool
$docblock_property_types_seal_properties  : bool
Whether using property annotations in docblocks should implicitly seal properties
$ensure_array_int_offsets_exist  : bool
$ensure_array_string_offsets_exist  : bool
$ensure_override_attribute  : bool
$error_baseline  : string|null
$ERROR_LEVELS  : array<string|int, string>
$eventDispatcher  : EventDispatcher
$find_unused_baseline_entry  : bool
$find_unused_code  : bool
$find_unused_issue_handler_suppression  : bool
$find_unused_psalm_suppress  : bool
$find_unused_variables  : bool
$forbidden_constants  : array<string, bool>
$forbidden_functions  : array<lowercase-string, bool>
$global_cache_directory  : string|null
The directory to store all Psalm project caches
$globals  : array<string, string>
$hash  : string
$hide_all_errors_except_passed_files  : bool
$hide_external_errors  : bool
$hoist_constants  : bool
$ignore_internal_falsable_issues  : bool
$ignore_internal_nullable_issues  : bool
$ignored_exceptions  : array<string, bool>
$ignored_exceptions_and_descendants  : array<string, bool>
$ignored_exceptions_and_descendants_in_global_scope  : array<string, bool>
$ignored_exceptions_in_global_scope  : array<string, bool>
$include_php_versions_in_error_baseline  : bool
$infer_property_types_from_constructor  : bool
$internal_stubs  : array<string|int, string>
$level  : 1|2|3|4|5|6|7|8
$limit_method_complexity  : bool
$literal_array_key_check  : bool
$max_avg_path_length  : int
$max_graph_size  : int
$max_shaped_array_size  : int
$max_string_length  : int
$memoize_method_calls  : bool
$php_extensions  : array<string, bool|null>
A list of php extensions supported by Psalm.
$php_extensions_not_supported  : array<string, true>
A list of php extensions required by the project that aren't fully supported by Psalm.
$php_extensions_supported_by_psalm_callmaps  : array<int, non-empty-string>
A list of php extensions described in CallMap Psalm files as opposite to stub files loaded by condition (see stubs/extensions dir).
$plugin_paths  : array<string|int, string>
$remember_property_assignments_after_call  : bool
$resolve_from_config_file  : bool
$restrict_return_types  : bool
$run_taint_analysis  : bool
$scan_threads  : int<1, max>|null
$seal_all_methods  : bool
$seal_all_properties  : bool
$show_mixed_issues  : bool|null
$skip_checks_on_unresolvable_includes  : bool
$source_filename  : string|null
$strict_binary_operands  : bool
$threads  : int<1, max>|null
$throw_exception  : bool
Whether or not to throw an exception on first error
$trigger_error_exits  : "default"|"never"|"always"
$use_docblock_property_types  : bool
Whether or not to use types as defined in property docblocks.
$use_docblock_types  : bool
Whether or not to use types as defined in docblocks
$use_igbinary  : bool
$use_phpdoc_method_without_magic_or_parent  : bool
$use_phpdoc_property_without_magic_or_parent  : bool
$use_phpstorm_meta_path  : bool
$project_files  : ProjectFileFilter|null
$cache_directory_initialized  : bool
$composer_class_loader  : ClassLoader|null
$configured_php_version  : string|null
The PHP version to assume as declared in the config file
$extra_files  : ProjectFileFilter|null
$file_extensions  : array<int, string>
$filetype_analyzer_paths  : array<string, string>
$filetype_analyzers  : array<string, FileAnalyzer>>
$filetype_scanner_paths  : array<string, string>
$filetype_scanners  : array<string, FileScanner>>
$include_collector  : IncludeCollector|null
$instance  : static|null
$issue_handlers  : array<string, IssueHandler>
$mock_classes  : array<int, string>
$plugin_classes  : array<string|int, SimpleXMLElement}>
$plugins  : array<class-string, PluginInterface>
$predefined_constants  : array<string, mixed>
$predefined_functions  : array<callable-string, bool>
$preloaded_stub_files  : array<string, string>
$report_info  : bool
$stub_files  : array<string, string>
$taint_analysis_ignored_files  : TaintAnalysisFileFilter|null
$universal_object_crates  : array<int, lowercase-string>
These are special object classes that allow any and all properties to be get/set on them

Methods

addPluginClass()  : void
addPluginPath()  : void
addPreloadedStubFile()  : void
addStubFile()  : void
addUniversalObjectCrate()  : void
collectPredefinedConstants()  : void
collectPredefinedFunctions()  : void
combineIssueHandlerSuppressions()  : void
computeHash()  : string
Computes the hash to use for a cache folder from CLI flags and from the config file's xml contents
getCacheDirectory()  : string|null
getComposerFilePathForClassLike()  : string|false
getConfigForPath()  : Config
Gets a Config object from an XML file.
getExtraDirectories()  : array<string|int, string>
getFileExtensions()  : array<int, string>
getFiletypeAnalyzers()  : array<string, FileAnalyzer>>
getFiletypeScanners()  : array<string, FileScanner>>
getGlobalCacheDirectory()  : string|null
getInstance()  : Config
getIssueHandlers()  : array<string, IssueHandler>
getIssueHandlerSuppressions()  : array<string|int, array{type: string, index: int, count: int}>
getMockClasses()  : array<int, string>
getParentIssueType()  : string|null
getPhpVersion()  : string|null
getPHPVersionFromComposerJson()  : string|null
getPhpVersionFromConfig()  : string|null
getPluginClasses()  : array<string|int, SimpleXMLElement}>
getPotentialComposerFilePathForClassLike()  : string|null
getPredefinedConstants()  : array<string, mixed>
getPredefinedFunctions()  : array<callable-string, bool>
getProjectDirectories()  : array<string|int, string>
getProjectFiles()  : array<string|int, string>
getReportingLevelForArgument()  : string|null
getReportingLevelForClass()  : string|null
getReportingLevelForClassConstant()  : string|null
getReportingLevelForFile()  : string
getReportingLevelForFunction()  : string|null
getReportingLevelForIssue()  : string
getReportingLevelForMethod()  : string|null
getReportingLevelForProperty()  : string|null
getReportingLevelForVariable()  : string|null
getStubFiles()  : array<string, string>
getUniversalObjectCrates()  : array<int, lowercase-string>
hasStubFile()  : bool
initializePlugins()  : void
Initialises all the plugins (done once the config is fully loaded)
isInExtraDirs()  : bool
isInProjectDirs()  : bool
loadFromXML()  : Config
Creates a new config object from an XML string
loadFromXMLFile()  : Config
Creates a new config object from the file
locateConfigFile()  : string|null
Searches up a folder hierarchy for the most immediate config.
mustBeIgnored()  : bool
processPluginFileExtensions()  : void
removeCacheDirectory()  : void
reportIssueInFile()  : bool
reportTypeStatsForFile()  : bool
safeSetAdvancedErrorLevel()  : void
safeSetCustomErrorLevel()  : void
setAdvancedErrorLevel()  : void
setComposerClassLoader()  : void
setCustomErrorLevel()  : void
setIncludeCollector()  : void
setServerMode()  : void
shortenFileName()  : string
trackTaintsInPath()  : bool
useStrictTypesForFile()  : bool
visitComposerAutoloadFiles()  : void
visitPreloadedStubFiles()  : void
visitStubFiles()  : void
fromXmlAndPaths()  : self
getPluginClassForPath()  : T>
lineNumberToByteOffset()  : int
loadDomDocument()  : DOMDocument
loadFileExtensions()  : void
loadPlugin()  : PluginInterface
processConfigDeprecations()  : void
processDeprecatedAttribute()  : void
processDeprecatedElement()  : void
requirePath()  : void
setBooleanAttribute()  : void
validateXmlConfig()  : void

Constants

CONFIG_NAMESPACE

public final mixed CONFIG_NAMESPACE = 'https://getpsalm.org/schema/config'

DEFAULT_BASELINE_NAME

public final mixed DEFAULT_BASELINE_NAME = 'psalm-baseline.xml'

REPORT_ERROR

public final mixed REPORT_ERROR = 'error'

REPORT_INFO

public final mixed REPORT_INFO = 'info'

REPORT_SUPPRESS

public final mixed REPORT_SUPPRESS = 'suppress'

DEFAULT_FILE_NAMES

private mixed DEFAULT_FILE_NAMES = ['psalm.xml', 'psalm.xml.dist', 'psalm.dist.xml']

MIXED_ISSUES

private array<string|int, mixed> MIXED_ISSUES = ['MixedArgument', 'MixedArrayAccess', 'MixedArrayAssignment', 'MixedArrayOffset', 'MixedArrayTypeCoercion', 'MixedAssignment', 'MixedFunctionCall', 'MixedMethodCall', 'MixedOperand', 'MixedPropertyFetch', 'MixedPropertyAssignment', 'MixedReturnStatement', 'MixedStringOffsetAssignment', 'MixedArgumentTypeCoercion', 'MixedPropertyTypeCoercion', 'MixedReturnTypeCoercion']

Properties

$add_param_default_to_docblock_type

public bool $add_param_default_to_docblock_type = false

$all_constants_global

public bool $all_constants_global = false

$all_functions_global

public bool $all_functions_global = false

$allow_includes

public bool $allow_includes = true

$allow_internal_named_arg_calls

public bool $allow_internal_named_arg_calls = true

$allow_named_arg_calls

public bool $allow_named_arg_calls = true

$allow_string_standin_for_class

public bool $allow_string_standin_for_class = false

$autoloader

Path to the autoader

public string|null $autoloader = null

$base_dir

The base directory of this config file without trailing slash

public string $base_dir

$check_for_throws_docblock

public bool $check_for_throws_docblock = false

$check_for_throws_in_global_scope

public bool $check_for_throws_in_global_scope = false

$compressor

public "lz4"|"deflate"|"off" $compressor = 'off'

$config_warnings

public array<int, string> $config_warnings = []

$debug_emitted_issues

public bool $debug_emitted_issues = false

whether to emit a backtrace of emitted issues to stderr

$disable_suppress_all

public bool $disable_suppress_all = false

$disable_var_parsing

public bool $disable_var_parsing = false

$docblock_property_types_seal_properties

Whether using property annotations in docblocks should implicitly seal properties

public bool $docblock_property_types_seal_properties = true

$ensure_array_int_offsets_exist

public bool $ensure_array_int_offsets_exist = false

$ensure_array_string_offsets_exist

public bool $ensure_array_string_offsets_exist = false

$ensure_override_attribute

public bool $ensure_override_attribute = false

$error_baseline

public string|null $error_baseline = null

$ERROR_LEVELS

public static array<string|int, string> $ERROR_LEVELS = [self::REPORT_INFO, self::REPORT_ERROR, self::REPORT_SUPPRESS]

$eventDispatcher

public EventDispatcher $eventDispatcher

$find_unused_baseline_entry

public bool $find_unused_baseline_entry = true

$find_unused_code

public bool $find_unused_code = true

$find_unused_issue_handler_suppression

public bool $find_unused_issue_handler_suppression = true

$find_unused_psalm_suppress

public bool $find_unused_psalm_suppress = false

$find_unused_variables

public bool $find_unused_variables = false

$forbidden_constants

public array<string, bool> $forbidden_constants = []

$forbidden_functions

public array<lowercase-string, bool> $forbidden_functions = []

$global_cache_directory

The directory to store all Psalm project caches

public string|null $global_cache_directory = null

$globals

public array<string, string> $globals = []

$hide_all_errors_except_passed_files

public bool $hide_all_errors_except_passed_files = false

$hide_external_errors

public bool $hide_external_errors = false

$hoist_constants

public bool $hoist_constants = false

$ignore_internal_falsable_issues

public bool $ignore_internal_falsable_issues = false

$ignore_internal_nullable_issues

public bool $ignore_internal_nullable_issues = false

$ignored_exceptions

public array<string, bool> $ignored_exceptions = []

$ignored_exceptions_and_descendants

public array<string, bool> $ignored_exceptions_and_descendants = []

$ignored_exceptions_and_descendants_in_global_scope

public array<string, bool> $ignored_exceptions_and_descendants_in_global_scope = []

$ignored_exceptions_in_global_scope

public array<string, bool> $ignored_exceptions_in_global_scope = []

$include_php_versions_in_error_baseline

public bool $include_php_versions_in_error_baseline = false

$infer_property_types_from_constructor

public bool $infer_property_types_from_constructor = true

$internal_stubs

public array<string|int, string> $internal_stubs = []

$level

public 1|2|3|4|5|6|7|8 $level = 1

$limit_method_complexity

public bool $limit_method_complexity = false

$literal_array_key_check

public bool $literal_array_key_check = false

$max_avg_path_length

public int $max_avg_path_length = 70

$max_graph_size

public int $max_graph_size = 200

$max_shaped_array_size

public int $max_shaped_array_size = 100

$max_string_length

public int $max_string_length = 1000

$memoize_method_calls

public bool $memoize_method_calls = false

$php_extensions

A list of php extensions supported by Psalm.

public array<string, bool|null> $php_extensions = ["amqp" => null, "apcu" => null, "decimal" => null, "dom" => null, "ds" => null, "ffi" => null, "geos" => null, "gmp" => null, "ibm_db2" => null, "mongodb" => null, "mysqli" => null, "pdo" => null, "random" => null, "rdkafka" => null, "redis" => null, "simplexml" => null, "soap" => null, "xdebug" => null]

Where key - extension name (without ext- prefix), value - whether to load extension’s stub. Values:

  • true: ext enabled explicitly or bundled with PHP (should load stubs)
  • false: ext disabled explicitly (should not load stubs)
  • null: state is unknown (e.g. config not processed yet) or ext neither explicitly enabled or disabled.
Tags
psalm-readonly-allow-private-mutation

$php_extensions_not_supported

A list of php extensions required by the project that aren't fully supported by Psalm.

public array<string, true> $php_extensions_not_supported = []

$php_extensions_supported_by_psalm_callmaps

A list of php extensions described in CallMap Psalm files as opposite to stub files loaded by condition (see stubs/extensions dir).

public array<int, non-empty-string> $php_extensions_supported_by_psalm_callmaps = ['apache', 'bcmath', 'bzip2', 'calendar', 'ctype', 'curl', 'dom', 'enchant', 'exif', 'filter', 'gd', 'gettext', 'gmp', 'hash', 'ibm_db2', 'iconv', 'imap', 'intl', 'json', 'ldap', 'libxml', 'mbstring', 'mysqli', 'mysqlnd', 'mhash', 'oci8', 'opcache', 'openssl', 'pcntl', 'PDO', 'pdo_mysql', 'pdo-sqlite', 'pdo-pgsql', 'pgsql', 'pspell', 'phar', 'phpdbg', 'posix', 'redis', 'readline', 'session', 'sockets', 'sqlite3', 'snmp', 'soap', 'sodium', 'shmop', 'sysvsem', 'tidy', 'tokenizer', 'uodbc', 'xml', 'xmlreader', 'xmlwriter', 'xsl', 'zip', 'zlib']
Tags
see
https://www.php.net/manual/en/extensions.membership.php
readonly

$plugin_paths

public array<string|int, string> $plugin_paths = []

$remember_property_assignments_after_call

public bool $remember_property_assignments_after_call = true

$resolve_from_config_file

public bool $resolve_from_config_file = true

$restrict_return_types

public bool $restrict_return_types = false

$run_taint_analysis

public bool $run_taint_analysis = false

$scan_threads

public int<1, max>|null $scan_threads = null

$seal_all_methods

public bool $seal_all_methods = false

$seal_all_properties

public bool $seal_all_properties = false

$show_mixed_issues

public bool|null $show_mixed_issues = null

$skip_checks_on_unresolvable_includes

public bool $skip_checks_on_unresolvable_includes = false

$source_filename

public string|null $source_filename = null

$strict_binary_operands

public bool $strict_binary_operands = false

$threads

public int<1, max>|null $threads = null

$throw_exception

Whether or not to throw an exception on first error

public bool $throw_exception = false

$trigger_error_exits

public "default"|"never"|"always" $trigger_error_exits = 'default'

$use_docblock_property_types

Whether or not to use types as defined in property docblocks.

public bool $use_docblock_property_types = false

This is distinct from the above because you may want to use property docblocks, but not function docblocks.

$use_docblock_types

Whether or not to use types as defined in docblocks

public bool $use_docblock_types = true

$use_igbinary

public bool $use_igbinary = false

$use_phpdoc_method_without_magic_or_parent

public bool $use_phpdoc_method_without_magic_or_parent = false

$use_phpdoc_property_without_magic_or_parent

public bool $use_phpdoc_property_without_magic_or_parent = false

$use_phpstorm_meta_path

public bool $use_phpstorm_meta_path = true

$project_files

protected ProjectFileFilter|null $project_files = null

$cache_directory_initialized

private bool $cache_directory_initialized = false

$configured_php_version

The PHP version to assume as declared in the config file

private string|null $configured_php_version = null

$extra_files

private ProjectFileFilter|null $extra_files = null

$file_extensions

private array<int, string> $file_extensions = ['php']

$filetype_analyzer_paths

private array<string, string> $filetype_analyzer_paths = []

$filetype_analyzers

private array<string, FileAnalyzer>> $filetype_analyzers = []

$filetype_scanner_paths

private array<string, string> $filetype_scanner_paths = []

$filetype_scanners

private array<string, FileScanner>> $filetype_scanners = []

$include_collector

private IncludeCollector|null $include_collector = null

$instance

private static static|null $instance

$issue_handlers

private array<string, IssueHandler> $issue_handlers = []

$mock_classes

private array<int, string> $mock_classes = []

$plugin_classes

private array<string|int, SimpleXMLElement}> $plugin_classes = []

$predefined_constants

private array<string, mixed> $predefined_constants = []

$predefined_functions

private array<callable-string, bool> $predefined_functions = []

$preloaded_stub_files

private array<string, string> $preloaded_stub_files = []

$report_info

private bool $report_info = true

$stub_files

private array<string, string> $stub_files = []

$taint_analysis_ignored_files

private TaintAnalysisFileFilter|null $taint_analysis_ignored_files = null

$universal_object_crates

These are special object classes that allow any and all properties to be get/set on them

private array<int, lowercase-string> $universal_object_crates

Methods

addPluginClass()

public addPluginClass(string $class_name[, SimpleXMLElement|null $plugin_config = null ]) : void
Parameters
$class_name : string
$plugin_config : SimpleXMLElement|null = null

addPluginPath()

public addPluginPath(string $path) : void
Parameters
$path : string

addPreloadedStubFile()

public addPreloadedStubFile(string $stub_file) : void
Parameters
$stub_file : string

addStubFile()

public addStubFile(string $stub_file) : void
Parameters
$stub_file : string

addUniversalObjectCrate()

public addUniversalObjectCrate(string $class) : void
Parameters
$class : string

collectPredefinedConstants()

public collectPredefinedConstants() : void

collectPredefinedFunctions()

public collectPredefinedFunctions() : void

combineIssueHandlerSuppressions()

public combineIssueHandlerSuppressions(array<string|int, array{type: string, index: int, count: int}> $filters) : void
Parameters
$filters : array<string|int, array{type: string, index: int, count: int}>

computeHash()

Computes the hash to use for a cache folder from CLI flags and from the config file's xml contents

public computeHash() : string
Return values
string

getCacheDirectory()

public getCacheDirectory() : string|null
Return values
string|null

getComposerFilePathForClassLike()

public getComposerFilePathForClassLike(string $fq_classlike_name) : string|false
Parameters
$fq_classlike_name : string
Return values
string|false

getConfigForPath()

Gets a Config object from an XML file.

public static getConfigForPath(string $path, string $current_dir) : Config

Searches up a folder hierarchy for the most immediate config.

Parameters
$path : string
$current_dir : string
Tags
throws
ConfigException

if a config path is not found

Return values
Config

getExtraDirectories()

public getExtraDirectories() : array<string|int, string>
Return values
array<string|int, string>

getFileExtensions()

public getFileExtensions() : array<int, string>
Return values
array<int, string>

getFiletypeAnalyzers()

public getFiletypeAnalyzers() : array<string, FileAnalyzer>>
Return values
array<string, FileAnalyzer>>

getFiletypeScanners()

public getFiletypeScanners() : array<string, FileScanner>>
Return values
array<string, FileScanner>>

getGlobalCacheDirectory()

public getGlobalCacheDirectory() : string|null
Return values
string|null

getIssueHandlers()

public getIssueHandlers() : array<string, IssueHandler>
Return values
array<string, IssueHandler>

getIssueHandlerSuppressions()

public getIssueHandlerSuppressions() : array<string|int, array{type: string, index: int, count: int}>
Return values
array<string|int, array{type: string, index: int, count: int}>

getMockClasses()

public getMockClasses() : array<int, string>
Return values
array<int, string>

getParentIssueType()

public static getParentIssueType(string $issue_type) : string|null
Parameters
$issue_type : string
Tags
psalm-pure
Return values
string|null

getPhpVersion()

public getPhpVersion() : string|null
Return values
string|null

getPHPVersionFromComposerJson()

public getPHPVersionFromComposerJson() : string|null
Tags
psalm-suppress

MixedAssignment

psalm-suppress

MixedArrayAccess

Return values
string|null

getPhpVersionFromConfig()

public getPhpVersionFromConfig() : string|null
Return values
string|null

getPluginClasses()

public getPluginClasses() : array<string|int, SimpleXMLElement}>
Return values
array<string|int, SimpleXMLElement}>

getPotentialComposerFilePathForClassLike()

public getPotentialComposerFilePathForClassLike(string $class) : string|null
Parameters
$class : string
Return values
string|null

getPredefinedConstants()

public getPredefinedConstants() : array<string, mixed>
Return values
array<string, mixed>

getPredefinedFunctions()

public getPredefinedFunctions() : array<callable-string, bool>
Return values
array<callable-string, bool>

getProjectDirectories()

public getProjectDirectories() : array<string|int, string>
Return values
array<string|int, string>

getProjectFiles()

public getProjectFiles() : array<string|int, string>
Return values
array<string|int, string>

getReportingLevelForArgument()

public getReportingLevelForArgument(string $issue_type, string $function_id) : string|null
Parameters
$issue_type : string
$function_id : string
Return values
string|null

getReportingLevelForClass()

public getReportingLevelForClass(string $issue_type, string $fq_classlike_name) : string|null
Parameters
$issue_type : string
$fq_classlike_name : string
Return values
string|null

getReportingLevelForClassConstant()

public getReportingLevelForClassConstant(string $issue_type, string $constant_id) : string|null
Parameters
$issue_type : string
$constant_id : string
Return values
string|null

getReportingLevelForFile()

public getReportingLevelForFile(string $issue_type, string $file_path) : string
Parameters
$issue_type : string
$file_path : string
Return values
string

getReportingLevelForFunction()

public getReportingLevelForFunction(string $issue_type, string $function_id) : string|null
Parameters
$issue_type : string
$function_id : string
Return values
string|null

getReportingLevelForIssue()

public getReportingLevelForIssue(CodeIssue $e) : string
Parameters
$e : CodeIssue
Return values
string

getReportingLevelForMethod()

public getReportingLevelForMethod(string $issue_type, string $method_id) : string|null
Parameters
$issue_type : string
$method_id : string
Return values
string|null

getReportingLevelForProperty()

public getReportingLevelForProperty(string $issue_type, string $property_id) : string|null
Parameters
$issue_type : string
$property_id : string
Return values
string|null

getReportingLevelForVariable()

public getReportingLevelForVariable(string $issue_type, string $var_name) : string|null
Parameters
$issue_type : string
$var_name : string
Return values
string|null

getStubFiles()

public getStubFiles() : array<string, string>
Return values
array<string, string>

getUniversalObjectCrates()

public getUniversalObjectCrates() : array<int, lowercase-string>
Return values
array<int, lowercase-string>

hasStubFile()

public hasStubFile(string $stub_file) : bool
Parameters
$stub_file : string
Return values
bool

initializePlugins()

Initialises all the plugins (done once the config is fully loaded)

public initializePlugins(ProjectAnalyzer $project_analyzer) : void
Parameters
$project_analyzer : ProjectAnalyzer

isInExtraDirs()

public isInExtraDirs(string $file_path) : bool
Parameters
$file_path : string
Return values
bool

isInProjectDirs()

public isInProjectDirs(string $file_path) : bool
Parameters
$file_path : string
Return values
bool

loadFromXML()

Creates a new config object from an XML string

public static loadFromXML(string $base_dir, non-empty-string $file_contents[, string|null $current_dir = null ][, string|null $file_path = null ]) : Config
Parameters
$base_dir : string
$file_contents : non-empty-string
$current_dir : string|null = null

Current working directory, if different to $base_dir

$file_path : string|null = null
Tags
throws
ConfigException
Return values
Config

loadFromXMLFile()

Creates a new config object from the file

public static loadFromXMLFile(string $file_path, string $current_dir) : Config
Parameters
$file_path : string
$current_dir : string
Return values
Config

locateConfigFile()

Searches up a folder hierarchy for the most immediate config.

public static locateConfigFile(string $path) : string|null
Parameters
$path : string
Tags
throws
ConfigException
Return values
string|null

mustBeIgnored()

public mustBeIgnored(string $file_path) : bool
Parameters
$file_path : string
Return values
bool

processPluginFileExtensions()

public processPluginFileExtensions(ProjectAnalyzer $projectAnalyzer) : void
Parameters
$projectAnalyzer : ProjectAnalyzer

removeCacheDirectory()

public static removeCacheDirectory(string $dir) : void
Parameters
$dir : string

reportIssueInFile()

public reportIssueInFile(string $issue_type, string $file_path) : bool
Parameters
$issue_type : string
$file_path : string
Return values
bool

reportTypeStatsForFile()

public reportTypeStatsForFile(string $file_path) : bool
Parameters
$file_path : string
Return values
bool

safeSetAdvancedErrorLevel()

public safeSetAdvancedErrorLevel(string $issue_key, array<string|int, mixed> $config[, string|null $default_error_level = null ]) : void
Parameters
$issue_key : string
$config : array<string|int, mixed>
$default_error_level : string|null = null

safeSetCustomErrorLevel()

public safeSetCustomErrorLevel(string $issue_key, string $error_level) : void
Parameters
$issue_key : string
$error_level : string

setAdvancedErrorLevel()

public setAdvancedErrorLevel(string $issue_key, array<string|int, mixed> $config[, string|null $default_error_level = null ]) : void
Parameters
$issue_key : string
$config : array<string|int, mixed>
$default_error_level : string|null = null

setComposerClassLoader()

public setComposerClassLoader([ClassLoader|null $loader = null ]) : void
Parameters
$loader : ClassLoader|null = null

setCustomErrorLevel()

public setCustomErrorLevel(string $issue_key, string $error_level) : void
Parameters
$issue_key : string
$error_level : string

setIncludeCollector()

public setIncludeCollector(IncludeCollector $include_collector) : void
Parameters
$include_collector : IncludeCollector

setServerMode()

public setServerMode() : void

shortenFileName()

public shortenFileName(string $to) : string
Parameters
$to : string
Return values
string

trackTaintsInPath()

public trackTaintsInPath(string $file_path) : bool
Parameters
$file_path : string
Return values
bool

useStrictTypesForFile()

public useStrictTypesForFile(string $file_path) : bool
Parameters
$file_path : string
Return values
bool

visitComposerAutoloadFiles()

public visitComposerAutoloadFiles(ProjectAnalyzer $project_analyzer[, Progress|null $progress = null ]) : void
Parameters
$project_analyzer : ProjectAnalyzer
$progress : Progress|null = null

fromXmlAndPaths()

private static fromXmlAndPaths(string $base_dir, non-empty-string $file_contents, string $current_dir, string|null $config_path) : self
Parameters
$base_dir : string
$file_contents : non-empty-string
$current_dir : string
$config_path : string|null
Tags
psalm-suppress

MixedAssignment

psalm-suppress

MixedPropertyFetch

throws
ConfigException
Return values
self

getPluginClassForPath()

private getPluginClassForPath(Codebase $codebase, string $path, T::class $must_extend) : T>
Parameters
$codebase : Codebase
$path : string
$must_extend : T::class
Tags
template
Return values
T>

lineNumberToByteOffset()

private static lineNumberToByteOffset(string $string, positive-int $line_number) : int
Parameters
$string : string
$line_number : positive-int

1-based line number

Tags
throws
OutOfBoundsException
Return values
int

0-based byte offset

loadDomDocument()

private static loadDomDocument(string $base_dir, non-empty-string $file_contents) : DOMDocument
Parameters
$base_dir : string
$file_contents : non-empty-string
Return values
DOMDocument

loadFileExtensions()

private loadFileExtensions(SimpleXMLElement $extensions) : void
Parameters
$extensions : SimpleXMLElement
Tags
throws
ConfigException

if a Config file could not be found

loadPlugin()

private loadPlugin(ProjectAnalyzer $projectAnalyzer, string $pluginClassName) : PluginInterface
Parameters
$projectAnalyzer : ProjectAnalyzer
$pluginClassName : string
Return values
PluginInterface

processConfigDeprecations()

private static processConfigDeprecations(self $config, DOMDocument $dom_document, string $file_contents, string $config_path) : void
Parameters
$config : self
$dom_document : DOMDocument
$file_contents : string
$config_path : string

processDeprecatedAttribute()

private static processDeprecatedAttribute(DOMAttr $attribute, string $file_contents, self $config, string $config_path) : void
Parameters
$attribute : DOMAttr
$file_contents : string
$config : self
$config_path : string

processDeprecatedElement()

private static processDeprecatedElement(DOMElement $deprecated_element_xml, string $file_contents, self $config, string $config_path) : void
Parameters
$deprecated_element_xml : DOMElement
$file_contents : string
$config : self
$config_path : string

requirePath()

private static requirePath(string $path) : void
Parameters
$path : string

setBooleanAttribute()

private setBooleanAttribute(string $name, bool $value) : void
Parameters
$name : string
$value : bool

validateXmlConfig()

private static validateXmlConfig(string $base_dir, non-empty-string $file_contents) : void
Parameters
$base_dir : string
$file_contents : non-empty-string
Tags
throws
ConfigException

        
On this page

Search results