From 304ffeb0a30bc650634c0a0715c84ca7b3a8ecd0 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 27 May 2019 13:04:38 -0400 Subject: [PATCH] Revert "Switch to VoidProgress by default" This reverts commit 63b46be3616d44b4fbf9dcfd73c62a56ad272f8e. --- src/Psalm/Codebase.php | 4 ++-- src/Psalm/Config.php | 6 +++--- src/Psalm/Internal/Analyzer/ProjectAnalyzer.php | 4 ++-- src/Psalm/Internal/Codebase/ClassLikes.php | 4 ++-- src/Psalm/Internal/Provider/StatementsProvider.php | 3 +-- src/Psalm/Internal/Scanner/FileScanner.php | 4 ++-- src/Psalm/Progress/VoidProgress.php | 6 ------ tests/Config/PluginTest.php | 3 ++- tests/FileUpdates/AnalyzedMethodTest.php | 3 ++- tests/FileUpdates/CachedStorageTest.php | 3 ++- tests/FileUpdates/ErrorAfterUpdateTest.php | 3 ++- tests/FileUpdates/ErrorFixTest.php | 3 ++- tests/FileUpdates/TemporaryUpdateTest.php | 3 ++- tests/LanguageServer/CompletionTest.php | 3 ++- tests/LanguageServer/SymbolLookupTest.php | 3 ++- tests/Progress/VoidProgress.php | 8 ++++++++ tests/ProjectCheckerTest.php | 3 ++- 17 files changed, 38 insertions(+), 28 deletions(-) delete mode 100644 src/Psalm/Progress/VoidProgress.php create mode 100644 tests/Progress/VoidProgress.php diff --git a/src/Psalm/Codebase.php b/src/Psalm/Codebase.php index 80a9f765d..f97f633ff 100644 --- a/src/Psalm/Codebase.php +++ b/src/Psalm/Codebase.php @@ -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\VoidProgress; +use Psalm\Progress\DefaultProgress; 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 VoidProgress(); + $progress = new DefaultProgress(); } $this->config = $config; diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 464a1bf6a..367914c9b 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -18,7 +18,7 @@ use Psalm\Internal\Scanner\FileScanner; use Psalm\Plugin\Hook; use Psalm\PluginRegistrationSocket; use Psalm\Progress\Progress; -use Psalm\Progress\VoidProgress; +use Psalm\Progress\DefaultProgress; use SimpleXMLElement; class Config @@ -1441,7 +1441,7 @@ class Config public function visitStubFiles(Codebase $codebase, Progress $progress = null) { if ($progress === null) { - $progress = new VoidProgress(); + $progress = new DefaultProgress(); } $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 VoidProgress(); + $progress = new DefaultProgress(); } $this->collectPredefinedConstants(); diff --git a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php index 93bf70112..6381db5c9 100644 --- a/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php @@ -27,7 +27,7 @@ use Psalm\Issue\PossiblyUnusedProperty; use Psalm\Issue\UnusedMethod; use Psalm\Issue\UnusedProperty; use Psalm\Progress\Progress; -use Psalm\Progress\VoidProgress; +use Psalm\Progress\DefaultProgress; use Psalm\Type; use Psalm\Issue\CodeIssue; @@ -214,7 +214,7 @@ class ProjectAnalyzer $show_snippet = true ) { if ($progress === null) { - $progress = new VoidProgress(); + $progress = new DefaultProgress(); } $this->parser_cache_provider = $providers->parser_cache_provider; diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index 073f52aa9..8f1be757d 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -18,7 +18,7 @@ use Psalm\IssueBuffer; use Psalm\Internal\Provider\ClassLikeStorageProvider; use Psalm\Internal\Provider\FileReferenceProvider; use Psalm\Progress\Progress; -use Psalm\Progress\VoidProgress; +use Psalm\Progress\DefaultProgress; 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 VoidProgress(); + $progress = new DefaultProgress(); } $progress->debug('Checking class references' . PHP_EOL); diff --git a/src/Psalm/Internal/Provider/StatementsProvider.php b/src/Psalm/Internal/Provider/StatementsProvider.php index 2b3acfe8e..be93907d2 100644 --- a/src/Psalm/Internal/Provider/StatementsProvider.php +++ b/src/Psalm/Internal/Provider/StatementsProvider.php @@ -4,7 +4,6 @@ namespace Psalm\Internal\Provider; use PhpParser; use Psalm\Progress\Progress; use Psalm\Progress\DefaultProgress; -use Psalm\Progress\VoidProgress; /** * @internal @@ -75,7 +74,7 @@ class StatementsProvider public function getStatementsForFile($file_path, Progress $progress = null) { if ($progress === null) { - $progress = new VoidProgress(); + $progress = new DefaultProgress(); } $from_cache = false; diff --git a/src/Psalm/Internal/Scanner/FileScanner.php b/src/Psalm/Internal/Scanner/FileScanner.php index c5d5b231a..5ff1b9e04 100644 --- a/src/Psalm/Internal/Scanner/FileScanner.php +++ b/src/Psalm/Internal/Scanner/FileScanner.php @@ -6,7 +6,7 @@ use PhpParser\NodeTraverser; use Psalm\Codebase; use Psalm\FileSource; use Psalm\Progress\Progress; -use Psalm\Progress\VoidProgress; +use Psalm\Progress\DefaultProgress; 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 VoidProgress(); + $progress = new DefaultProgress(); } if ((!$this->will_analyze || $file_storage->deep_scan) diff --git a/src/Psalm/Progress/VoidProgress.php b/src/Psalm/Progress/VoidProgress.php deleted file mode 100644 index 54bce3cad..000000000 --- a/src/Psalm/Progress/VoidProgress.php +++ /dev/null @@ -1,6 +0,0 @@ -project_analyzer->setPhpVersion('7.3'); } diff --git a/tests/FileUpdates/CachedStorageTest.php b/tests/FileUpdates/CachedStorageTest.php index 14f3763bf..833b0d0c3 100644 --- a/tests/FileUpdates/CachedStorageTest.php +++ b/tests/FileUpdates/CachedStorageTest.php @@ -5,6 +5,7 @@ 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 @@ -37,7 +38,7 @@ class CachedStorageTest extends \Psalm\Tests\TestCase true, ProjectAnalyzer::TYPE_CONSOLE, 1, - null + new VoidProgress() ); $this->project_analyzer->setPhpVersion('7.3'); } diff --git a/tests/FileUpdates/ErrorAfterUpdateTest.php b/tests/FileUpdates/ErrorAfterUpdateTest.php index 398788a05..a7c8d9c40 100644 --- a/tests/FileUpdates/ErrorAfterUpdateTest.php +++ b/tests/FileUpdates/ErrorAfterUpdateTest.php @@ -5,6 +5,7 @@ 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 @@ -37,7 +38,7 @@ class ErrorAfterUpdateTest extends \Psalm\Tests\TestCase true, ProjectAnalyzer::TYPE_CONSOLE, 1, - null + new VoidProgress() ); $this->project_analyzer->setPhpVersion('7.3'); } diff --git a/tests/FileUpdates/ErrorFixTest.php b/tests/FileUpdates/ErrorFixTest.php index 473ad16b5..e657e22ed 100644 --- a/tests/FileUpdates/ErrorFixTest.php +++ b/tests/FileUpdates/ErrorFixTest.php @@ -5,6 +5,7 @@ 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 @@ -38,7 +39,7 @@ class ErrorFixTest extends \Psalm\Tests\TestCase true, ProjectAnalyzer::TYPE_CONSOLE, 1, - null + new VoidProgress() ); $this->project_analyzer->setPhpVersion('7.3'); } diff --git a/tests/FileUpdates/TemporaryUpdateTest.php b/tests/FileUpdates/TemporaryUpdateTest.php index 869ff194b..5d1d223db 100644 --- a/tests/FileUpdates/TemporaryUpdateTest.php +++ b/tests/FileUpdates/TemporaryUpdateTest.php @@ -5,6 +5,7 @@ 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 @@ -38,7 +39,7 @@ class TemporaryUpdateTest extends \Psalm\Tests\TestCase true, ProjectAnalyzer::TYPE_CONSOLE, 1, - null + new VoidProgress() ); $this->project_analyzer->setPhpVersion('7.3'); } diff --git a/tests/LanguageServer/CompletionTest.php b/tests/LanguageServer/CompletionTest.php index a1d346fb3..d08254985 100644 --- a/tests/LanguageServer/CompletionTest.php +++ b/tests/LanguageServer/CompletionTest.php @@ -7,6 +7,7 @@ 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 @@ -39,7 +40,7 @@ class CompletionTest extends \Psalm\Tests\TestCase true, ProjectAnalyzer::TYPE_CONSOLE, 1, - null + new VoidProgress() ); $this->project_analyzer->setPhpVersion('7.3'); $this->project_analyzer->getCodebase()->store_node_types = true; diff --git a/tests/LanguageServer/SymbolLookupTest.php b/tests/LanguageServer/SymbolLookupTest.php index 0ff50f4d4..ef202e06d 100644 --- a/tests/LanguageServer/SymbolLookupTest.php +++ b/tests/LanguageServer/SymbolLookupTest.php @@ -7,6 +7,7 @@ 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 @@ -39,7 +40,7 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase true, ProjectAnalyzer::TYPE_CONSOLE, 1, - null + new VoidProgress() ); $this->project_analyzer->setPhpVersion('7.3'); diff --git a/tests/Progress/VoidProgress.php b/tests/Progress/VoidProgress.php new file mode 100644 index 000000000..83db49939 --- /dev/null +++ b/tests/Progress/VoidProgress.php @@ -0,0 +1,8 @@ +