1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Switch to VoidProgress by default

This commit is contained in:
Ilija Tovilo 2019-05-25 19:44:37 +02:00 committed by Matthew Brown
parent 0c5837b246
commit 63b46be361
17 changed files with 28 additions and 38 deletions

View File

@ -13,7 +13,7 @@ use Psalm\Internal\Provider\FileStorageProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Internal\Provider\StatementsProvider;
use Psalm\Progress\Progress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use Psalm\Storage\ClassLikeStorage;
use Psalm\Storage\FileStorage;
use Psalm\Storage\FunctionLikeStorage;
@ -198,7 +198,7 @@ class Codebase
Progress $progress = null
) {
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
$this->config = $config;

View File

@ -18,7 +18,7 @@ use Psalm\Internal\Scanner\FileScanner;
use Psalm\Plugin\Hook;
use Psalm\PluginRegistrationSocket;
use Psalm\Progress\Progress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use SimpleXMLElement;
class Config
@ -1441,7 +1441,7 @@ class Config
public function visitStubFiles(Codebase $codebase, Progress $progress = null)
{
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
$codebase->register_stub_files = true;
@ -1554,7 +1554,7 @@ class Config
public function visitComposerAutoloadFiles(ProjectAnalyzer $project_analyzer, Progress $progress = null)
{
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
$this->collectPredefinedConstants();

View File

@ -11,7 +11,7 @@ use Psalm\Internal\Provider\FileReferenceProvider;
use Psalm\Internal\Provider\ParserCacheProvider;
use Psalm\Internal\Provider\Providers;
use Psalm\Progress\Progress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use Psalm\Type;
/**
@ -176,7 +176,7 @@ class ProjectAnalyzer
$show_snippet = true
) {
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
$this->parser_cache_provider = $providers->parser_cache_provider;

View File

@ -18,7 +18,7 @@ use Psalm\IssueBuffer;
use Psalm\Internal\Provider\ClassLikeStorageProvider;
use Psalm\Internal\Provider\FileReferenceProvider;
use Psalm\Progress\Progress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use Psalm\Storage\ClassLikeStorage;
use Psalm\Type;
use ReflectionProperty;
@ -670,7 +670,7 @@ class ClassLikes
public function checkClassReferences(Methods $methods, Progress $progress = null)
{
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
$progress->debug('Checking class references' . PHP_EOL);

View File

@ -4,6 +4,7 @@ namespace Psalm\Internal\Provider;
use PhpParser;
use Psalm\Progress\Progress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
/**
* @internal
@ -74,7 +75,7 @@ class StatementsProvider
public function getStatementsForFile($file_path, Progress $progress = null)
{
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
$from_cache = false;

View File

@ -6,7 +6,7 @@ use PhpParser\NodeTraverser;
use Psalm\Codebase;
use Psalm\FileSource;
use Psalm\Progress\Progress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use Psalm\Storage\FileStorage;
use Psalm\Internal\Visitor\ReflectorVisitor;
@ -54,7 +54,7 @@ class FileScanner implements FileSource
Progress $progress = null
) {
if ($progress === null) {
$progress = new DefaultProgress();
$progress = new VoidProgress();
}
if ((!$this->will_analyze || $file_storage->deep_scan)

View File

@ -0,0 +1,6 @@
<?php
namespace Psalm\Progress;
class VoidProgress extends Progress
{
}

View File

@ -9,7 +9,6 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Plugin\Hook\AfterCodebasePopulatedInterface;
use Psalm\PluginRegistrationSocket;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class PluginTest extends \Psalm\Tests\TestCase
@ -62,7 +61,7 @@ class PluginTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
}

View File

@ -5,7 +5,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class AnalyzedMethodTest extends \Psalm\Tests\TestCase
@ -38,7 +37,7 @@ class AnalyzedMethodTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');
}

View File

@ -5,7 +5,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class CachedStorageTest extends \Psalm\Tests\TestCase
@ -38,7 +37,7 @@ class CachedStorageTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');
}

View File

@ -5,7 +5,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class ErrorAfterUpdateTest extends \Psalm\Tests\TestCase
@ -38,7 +37,7 @@ class ErrorAfterUpdateTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');
}

View File

@ -5,7 +5,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class ErrorFixTest extends \Psalm\Tests\TestCase
@ -39,7 +38,7 @@ class ErrorFixTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');
}

View File

@ -5,7 +5,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class TemporaryUpdateTest extends \Psalm\Tests\TestCase
@ -39,7 +38,7 @@ class TemporaryUpdateTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');
}

View File

@ -7,7 +7,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class CompletionTest extends \Psalm\Tests\TestCase
@ -40,7 +39,7 @@ class CompletionTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');
$this->project_analyzer->getCodebase()->store_node_types = true;

View File

@ -7,7 +7,6 @@ use Psalm\Internal\Analyzer\FileAnalyzer;
use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Internal\Provider\Providers;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\VoidProgress;
use Psalm\Tests\TestConfig;
class SymbolLookupTest extends \Psalm\Tests\TestCase
@ -40,7 +39,7 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
$this->project_analyzer->setPhpVersion('7.3');

View File

@ -1,8 +0,0 @@
<?php
namespace Psalm\Tests\Progress;
use Psalm\Progress\Progress;
class VoidProgress extends Progress
{
}

View File

@ -8,7 +8,6 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer;
use Psalm\Plugin\Hook\AfterCodebasePopulatedInterface;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\Progress\EchoProgress;
use Psalm\Tests\Progress\VoidProgress;
class ProjectCheckerTest extends TestCase
{
@ -63,7 +62,7 @@ class ProjectCheckerTest extends TestCase
true,
ProjectAnalyzer::TYPE_CONSOLE,
1,
new VoidProgress()
null
);
}