diff --git a/src/Framework/Config/Environment.php b/src/Framework/Config/Environment.php index 03a1cdb9..43b89bb9 100644 --- a/src/Framework/Config/Environment.php +++ b/src/Framework/Config/Environment.php @@ -23,7 +23,7 @@ final readonly class Environment { $key = $this->keyToString($key); - // 1. Check if direct env var exists in internal array and is not empty + // 1. Check if a direct env var exists in an internal array and is not empty. // Empty strings are treated as "not set" to allow Docker Secrets resolution if (isset($this->variables[$key])) { $value = $this->variables[$key]; @@ -54,7 +54,7 @@ final readonly class Environment // This preserves the original behavior: if variable is explicitly set to empty string, return it // BUT: Only do this if no Docker Secret was found (otherwise empty string would override the secret) // secretValue is null if no secret was found - if (isset($this->variables[$key]) && $secretValue === null) { + if (isset($this->variables[$key])) { return $this->variables[$key]; } diff --git a/src/Framework/Discovery/Exceptions/DiscoveryException.php b/src/Framework/Discovery/Exceptions/DiscoveryException.php index a693f93f..6361d318 100644 --- a/src/Framework/Discovery/Exceptions/DiscoveryException.php +++ b/src/Framework/Discovery/Exceptions/DiscoveryException.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Framework\Discovery\Exceptions; +use App\Framework\Exception\Core\DiscoveryErrorCode; +use App\Framework\Exception\Core\FileSystemErrorCode; use App\Framework\Exception\ErrorCode; use App\Framework\Exception\ExceptionContext; use App\Framework\Exception\FrameworkException; diff --git a/src/Framework/Discovery/Processing/FileProcessor.php b/src/Framework/Discovery/Processing/FileProcessor.php index 02b96d2b..9f277d64 100644 --- a/src/Framework/Discovery/Processing/FileProcessor.php +++ b/src/Framework/Discovery/Processing/FileProcessor.php @@ -16,6 +16,7 @@ use App\Framework\Filesystem\FileScanner; use App\Framework\Filesystem\FileSystemService; use App\Framework\Filesystem\ValueObjects\FilePattern; use App\Framework\Logging\Logger; +use App\Framework\Logging\ValueObjects\LogContext; use App\Framework\Performance\MemoryMonitor; use Generator; use Throwable; @@ -129,7 +130,7 @@ final readonly class FileProcessor implements DiscoveryProcessor } catch (Throwable $e) { $this->logger?->warning( - "Failed to process file {$file->getPath()->toString()}: {$e->getMessage()}" + "Failed to process file {$file->getPath()->toString()}: {$e->getMessage()}", LogContext::withException($e) ); } }