Skip to content

Commit

Permalink
remove is cache debug
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 22, 2021
1 parent c2ce610 commit 77a90c5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ private function reportCacheDebugAndSaveDependentFiles(SmartFileInfo $smartFileI
return;
}

$this->reportCacheDebug($smartFileInfo, $dependentFiles);

// save for cache
$this->changedFilesDetector->addFileWithDependencies($smartFileInfo, $dependentFiles);
}
Expand All @@ -180,25 +178,4 @@ private function resolveClassName(Class_ | Interface_ | Trait_ $classLike): stri

return $classLike->name->toString();
}

/**
* @param string[] $dependentFiles
*/
private function reportCacheDebug(SmartFileInfo $smartFileInfo, array $dependentFiles): void
{
if (! $this->configuration->isCacheDebug()) {
return;
}
$message = sprintf(
'[debug] %d dependencies for "%s" file',
count($dependentFiles),
$smartFileInfo->getRealPath()
);

$this->symfonyStyle->note($message);

if ($dependentFiles !== []) {
$this->symfonyStyle->listing($dependentFiles);
}
}
}
4 changes: 0 additions & 4 deletions src/Autoloading/AdditionalAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ public function autoloadInput(InputInterface $input): void
public function autoloadPaths(): void
{
$autoloadPaths = $this->parameterProvider->provideArrayParameter(Option::AUTOLOAD_PATHS);
if ($autoloadPaths === []) {
return;
}

$this->dynamicSourceLocatorDecorator->addPaths($autoloadPaths);
}
}
12 changes: 0 additions & 12 deletions src/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ final class Configuration

private string $outputFormat;

private bool $isCacheDebug = false;

private bool $isCacheEnabled = false;

/**
Expand Down Expand Up @@ -59,7 +57,6 @@ public function resolveFromInput(InputInterface $input): void

$this->showProgressBar = $this->canShowProgressBar($input);
$this->showDiffs = ! (bool) $input->getOption(Option::NO_DIFFS);
$this->isCacheDebug = (bool) $input->getOption(Option::CACHE_DEBUG);

$this->outputFormat = (string) $input->getOption(Option::OUTPUT_FORMAT);

Expand Down Expand Up @@ -87,10 +84,6 @@ public function isDryRun(): bool

public function shouldShowProgressBar(): bool
{
if ($this->isCacheDebug) {
return false;
}

return $this->showProgressBar;
}

Expand All @@ -99,11 +92,6 @@ public function shouldClearCache(): bool
return $this->shouldClearCache;
}

public function isCacheDebug(): bool
{
return $this->isCacheDebug;
}

public function isCacheEnabled(): bool
{
return $this->isCacheEnabled;
Expand Down
5 changes: 0 additions & 5 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ final class Option
*/
public const ENABLE_CACHE = 'enable_cache';

/**
* @var string
*/
public const CACHE_DEBUG = 'cache-debug';

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ protected function configure(): void
'Hide diffs of changed files. Useful e.g. for nicer CI output.'
);

$this->addOption(Option::CACHE_DEBUG, null, InputOption::VALUE_NONE, 'Debug changed file cache');
$this->addOption(Option::CLEAR_CACHE, null, InputOption::VALUE_NONE, 'Clear unchaged files cache');
}

Expand Down
4 changes: 4 additions & 0 deletions src/StaticReflection/DynamicSourceLocatorDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public function __construct(
*/
public function addPaths(array $paths): void
{
if ($paths === []) {
return;
}

$files = $this->fileSystemFilter->filterFiles($paths);
$this->dynamicSourceLocatorProvider->addFiles($files);

Expand Down

0 comments on commit 77a90c5

Please sign in to comment.