1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

CacheProvider -> ParserCacheProvider

This commit is contained in:
Matthew Brown 2017-10-15 11:57:44 -04:00
parent 00aaa4adaf
commit 657d154288
12 changed files with 19 additions and 19 deletions

View File

@ -323,8 +323,8 @@ $update_docblocks = isset($options['update-docblocks']);
$threads = isset($options['threads']) ? (int)$options['threads'] : 1;
$cache_provider = isset($options['no-cache'])
? new Psalm\Provider\Cache\NoCacheProvider()
: new Psalm\Provider\CacheProvider();
? new Psalm\Provider\Cache\NoParserCacheProvider()
: new Psalm\Provider\ParserCacheProvider();
$project_checker = new ProjectChecker(
new Psalm\Provider\FileProvider(),

View File

@ -10,11 +10,11 @@ use Psalm\Issue\PossiblyUnusedMethod;
use Psalm\Issue\UnusedClass;
use Psalm\Issue\UnusedMethod;
use Psalm\IssueBuffer;
use Psalm\Provider\CacheProvider;
use Psalm\Provider\ClassLikeStorageProvider;
use Psalm\Provider\FileProvider;
use Psalm\Provider\FileReferenceProvider;
use Psalm\Provider\FileStorageProvider;
use Psalm\Provider\ParserCacheProvider;
use Psalm\Provider\StatementsProvider;
use Psalm\Storage\ClassLikeStorage;
use Psalm\Storage\FileStorage;
@ -45,7 +45,7 @@ class ProjectChecker
/** @var ClassLikeStorageProvider */
public $classlike_storage_provider;
/** @var CacheProvider */
/** @var ParserCacheProvider */
public $cache_provider;
/**
@ -249,7 +249,7 @@ class ProjectChecker
/**
* @param FileProvider $file_provider
* @param CacheProvider $cache_provider
* @param ParserCacheProvider $cache_provider
* @param bool $use_color
* @param bool $show_info
* @param string $output_format
@ -262,7 +262,7 @@ class ProjectChecker
*/
public function __construct(
FileProvider $file_provider,
CacheProvider $cache_provider,
ParserCacheProvider $cache_provider,
$use_color = true,
$show_info = true,
$output_format = self::TYPE_CONSOLE,

View File

@ -3,7 +3,7 @@ namespace Psalm\Provider\Cache;
use PhpParser;
class NoCacheProvider extends \Psalm\Provider\CacheProvider
class NoParserCacheProvider extends \Psalm\Provider\ParserCacheProvider
{
/**
* @param string $file_path

View File

@ -4,7 +4,7 @@ namespace Psalm\Provider;
use PhpParser;
use Psalm\Config;
class CacheProvider
class ParserCacheProvider
{
const FILE_HASHES = 'file_hashes_json';
const PARSER_CACHE_DIRECTORY = 'php-parser';

View File

@ -11,7 +11,7 @@ class StatementsProvider
/**
* @param string $file_path
* @param FileProvider $file_provider
* @param CacheProvider $cache_provider
* @param ParserCacheProvider $cache_provider
* @param bool $debug_output
*
* @return array<int, \PhpParser\Node\Stmt>
@ -19,7 +19,7 @@ class StatementsProvider
public static function getStatementsForFile(
$file_path,
FileProvider $file_provider,
CacheProvider $cache_provider,
ParserCacheProvider $cache_provider,
$debug_output = false
) {
$stmts = [];

View File

@ -33,7 +33,7 @@ class ConfigTest extends TestCase
$this->project_checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider()
new Provider\FakeParserCacheProvider()
);
}

View File

@ -21,7 +21,7 @@ class FileManipulationTest extends TestCase
$this->project_checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider()
new Provider\FakeParserCacheProvider()
);
$this->project_checker->setConfig(new TestConfig());

View File

@ -19,7 +19,7 @@ class JsonOutputTest extends TestCase
$this->project_checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider(),
new Provider\FakeParserCacheProvider(),
false,
true,
ProjectChecker::TYPE_JSON

View File

@ -3,7 +3,7 @@ namespace Psalm\Tests\Provider;
use PhpParser;
class FakeCacheProvider extends \Psalm\Provider\CacheProvider
class FakeParserCacheProvider extends \Psalm\Provider\ParserCacheProvider
{
/**
* @param string $file_path

View File

@ -20,7 +20,7 @@ class ReportOutputTest extends TestCase
$this->project_checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider(),
new Provider\FakeParserCacheProvider(),
false
);
$this->project_checker->reports['json'] = __DIR__ . '/test-report.json';
@ -40,7 +40,7 @@ class ReportOutputTest extends TestCase
foreach (['.xml', '.txt', '.json', '.emacs'] as $extension) {
$checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider(),
new Provider\FakeParserCacheProvider(),
false,
true,
\Psalm\Checker\ProjectChecker::TYPE_CONSOLE,
@ -63,7 +63,7 @@ class ReportOutputTest extends TestCase
{
$checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider(),
new Provider\FakeParserCacheProvider(),
false,
true,
\Psalm\Checker\ProjectChecker::TYPE_CONSOLE,

View File

@ -43,7 +43,7 @@ class TestCase extends PHPUnit_Framework_TestCase
$this->project_checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider()
new Provider\FakeParserCacheProvider()
);
$this->project_checker->setConfig(new TestConfig());
$this->project_checker->infer_types_from_usage = true;

View File

@ -20,7 +20,7 @@ class UnusedCodeTest extends TestCase
$this->project_checker = new \Psalm\Checker\ProjectChecker(
$this->file_provider,
new Provider\FakeCacheProvider()
new Provider\FakeParserCacheProvider()
);
$this->project_checker->setConfig(new TestConfig());