Fix psalm regressions.

This commit is contained in:
Chris Lightfoot-Wild 2025-08-06 00:25:55 +01:00
parent 7981956060
commit ac81542f5f
No known key found for this signature in database
7 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,7 @@ use Symfony\Component\Dotenv\Exception\PathException;
final class SymfonyDotenvProvider implements EnvSourceProvider
{
/** @psalm-suppress UndefinedClass */
#[\Override]
public function getEnvSource(): EnvSource
{
$installPath = InstalledVersions::getRootPackage()['install_path'];

View File

@ -16,6 +16,7 @@ use OpenTelemetry\Config\SDK\Configuration\Environment\EnvSourceProvider;
final class VlucasPhpdotenvProvider implements EnvSourceProvider
{
/** @psalm-suppress UndefinedClass */
#[\Override]
public function getEnvSource(): EnvSource
{
$backup = [$_SERVER, $_ENV];

View File

@ -16,6 +16,7 @@ final class LazyEnvSource implements EnvSource
) {
}
#[\Override]
public function readRaw(string $name): mixed
{
if (!$this->env instanceof EnvSource) {

View File

@ -25,6 +25,7 @@ class EnvironmentResolver implements ResolverInterface
return !Configuration::isEmpty($env);
}
#[\Override]
public function retrieveValue(string $variableName): mixed
{
$value = getenv($variableName);

View File

@ -27,6 +27,7 @@ class PhpIniResolver implements ResolverInterface
return $value;
}
#[\Override]
public function hasVariable(string $variableName): bool
{
$value = $this->accessor->get($variableName);

View File

@ -36,11 +36,13 @@ class SdkConfigurationResolver implements ResolverInterface
$this->reader = new EnvSourceReader($envSources);
}
#[\Override]
public function retrieveValue(string $variableName): mixed
{
return $this->reader->read($variableName);
}
#[\Override]
public function hasVariable(string $variableName): bool
{
return !Configuration::isEmpty($this->reader->read($variableName));

View File

@ -10,6 +10,7 @@ use OpenTelemetry\Config\SDK\Configuration\Environment\EnvSourceProvider;
class TestEnvSourceProvider implements EnvSourceProvider
{
#[\Override]
public function getEnvSource(): EnvSource
{
return new ArrayEnvSource([