mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
allow psalter to be run without cache (#3063)
This commit is contained in:
parent
ecac9d56c0
commit
b340f2b0ce
@ -32,6 +32,7 @@ $valid_long_options = [
|
|||||||
'find-unused-code', 'threads:', 'codeowner:',
|
'find-unused-code', 'threads:', 'codeowner:',
|
||||||
'allow-backwards-incompatible-changes:',
|
'allow-backwards-incompatible-changes:',
|
||||||
'add-newline-between-docblock-annotations:',
|
'add-newline-between-docblock-annotations:',
|
||||||
|
'no-cache'
|
||||||
];
|
];
|
||||||
|
|
||||||
// get options from command line
|
// get options from command line
|
||||||
@ -150,6 +151,8 @@ Options:
|
|||||||
--add-newline-between-docblock-annotations=BOOL
|
--add-newline-between-docblock-annotations=BOOL
|
||||||
Whether to add or not add a new line between docblock annotations. Defaults to true.
|
Whether to add or not add a new line between docblock annotations. Defaults to true.
|
||||||
|
|
||||||
|
--no-cache
|
||||||
|
Runs Psalm without using cache
|
||||||
HELP;
|
HELP;
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
@ -200,12 +203,18 @@ if ($config->resolve_from_config_file) {
|
|||||||
|
|
||||||
$threads = isset($options['threads']) ? (int)$options['threads'] : 1;
|
$threads = isset($options['threads']) ? (int)$options['threads'] : 1;
|
||||||
|
|
||||||
$providers = new Psalm\Internal\Provider\Providers(
|
if (isset($options['no-cache'])) {
|
||||||
new Psalm\Internal\Provider\FileProvider(),
|
$providers = new Psalm\Internal\Provider\Providers(
|
||||||
new Psalm\Internal\Provider\ParserCacheProvider($config),
|
new Psalm\Internal\Provider\FileProvider()
|
||||||
new Psalm\Internal\Provider\FileStorageCacheProvider($config),
|
);
|
||||||
new Psalm\Internal\Provider\ClassLikeStorageCacheProvider($config)
|
} else {
|
||||||
);
|
$providers = new Psalm\Internal\Provider\Providers(
|
||||||
|
new Psalm\Internal\Provider\FileProvider(),
|
||||||
|
new Psalm\Internal\Provider\ParserCacheProvider($config),
|
||||||
|
new Psalm\Internal\Provider\FileStorageCacheProvider($config),
|
||||||
|
new Psalm\Internal\Provider\ClassLikeStorageCacheProvider($config)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (array_key_exists('list-supported-issues', $options)) {
|
if (array_key_exists('list-supported-issues', $options)) {
|
||||||
echo implode(',', ProjectAnalyzer::getSupportedIssuesToFix()) . PHP_EOL;
|
echo implode(',', ProjectAnalyzer::getSupportedIssuesToFix()) . PHP_EOL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user