Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
70
src/Framework/Discovery/ValueObjects/DiscoveryOptions.php
Normal file
70
src/Framework/Discovery/ValueObjects/DiscoveryOptions.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Discovery\ValueObjects;
|
||||
|
||||
/**
|
||||
* Configuration options for discovery process
|
||||
*/
|
||||
final readonly class DiscoveryOptions
|
||||
{
|
||||
public function __construct(
|
||||
public ScanType $scanType = ScanType::FULL,
|
||||
public array $paths = ['/src'],
|
||||
public bool $useCache = true,
|
||||
public bool $parallel = false,
|
||||
public int $batchSize = 50,
|
||||
public bool $showProgress = false,
|
||||
public array $excludePatterns = [],
|
||||
public array $includePatterns = ['*.php']
|
||||
) {
|
||||
}
|
||||
|
||||
public static function defaults(): self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
public function withScanType(ScanType $scanType): self
|
||||
{
|
||||
return new self(
|
||||
scanType: $scanType,
|
||||
paths: $this->paths,
|
||||
useCache: $this->useCache,
|
||||
parallel: $this->parallel,
|
||||
batchSize: $this->batchSize,
|
||||
showProgress: $this->showProgress,
|
||||
excludePatterns: $this->excludePatterns,
|
||||
includePatterns: $this->includePatterns
|
||||
);
|
||||
}
|
||||
|
||||
public function withPaths(array $paths): self
|
||||
{
|
||||
return new self(
|
||||
scanType: $this->scanType,
|
||||
paths: $paths,
|
||||
useCache: $this->useCache,
|
||||
parallel: $this->parallel,
|
||||
batchSize: $this->batchSize,
|
||||
showProgress: $this->showProgress,
|
||||
excludePatterns: $this->excludePatterns,
|
||||
includePatterns: $this->includePatterns
|
||||
);
|
||||
}
|
||||
|
||||
public function withoutCache(): self
|
||||
{
|
||||
return new self(
|
||||
scanType: $this->scanType,
|
||||
paths: $this->paths,
|
||||
useCache: false,
|
||||
parallel: $this->parallel,
|
||||
batchSize: $this->batchSize,
|
||||
showProgress: $this->showProgress,
|
||||
excludePatterns: $this->excludePatterns,
|
||||
includePatterns: $this->includePatterns
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user