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:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -0,0 +1,72 @@
<?php
declare(strict_types=1);
namespace App\Framework\Discovery\ValueObjects;
use App\Framework\Core\ValueObjects\Byte;
use App\Framework\Core\ValueObjects\ClassName;
use App\Framework\Filesystem\FilePath;
/**
* Immutable value object for interface implementation mappings
* Replaces simple arrays with memory-efficient typed structure
*/
final readonly class InterfaceMapping
{
public function __construct(
public ClassName $interface,
public ClassName $implementation,
public FilePath $file
) {
}
public static function create(
string $interface,
string $implementation,
string $file
): self {
return new self(
interface: ClassName::create($interface),
implementation: ClassName::create($implementation),
file: FilePath::create($file)
);
}
/**
* Get unique identifier for deduplication
*/
public function getUniqueId(): string
{
return $this->interface->getFullyQualified() . '::' . $this->implementation->getFullyQualified();
}
/**
* Check if this mapping is the same as another
*/
public function isSameAs(self $other): bool
{
return $this->interface->equals($other->interface) &&
$this->implementation->equals($other->implementation);
}
/**
* Check if this implements the given interface
*/
public function implementsInterface(ClassName $interface): bool
{
return $this->interface->equals($interface);
}
/**
* Get memory footprint estimate
*/
public function getMemoryFootprint(): Byte
{
$bytes = strlen($this->interface->getFullyQualified()) +
strlen($this->implementation->getFullyQualified()) +
strlen($this->file->toString());
return Byte::fromBytes($bytes);
}
}