jaeger-client -> opentelemetry

This commit is contained in:
Andrew Dolgov
2023-10-20 17:12:29 +03:00
parent 45a9ff0c88
commit cdd7ad020e
1159 changed files with 93352 additions and 24252 deletions
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\SDK\Common\Util;
use LogicException;
class ClassConstantAccessor
{
public static function requireValue(string $className, string $constantName)
{
$constant = self::getFullName($className, $constantName);
if (!defined($constant)) {
throw new LogicException(
sprintf('The class "%s" does not have a constant "%s"', $className, $constantName)
);
}
return constant($constant);
}
public static function getValue(string $className, string $constantName)
{
$constant = self::getFullName($className, $constantName);
return defined($constant) ? constant($constant) : null;
}
private static function getFullName(string $className, string $constantName): string
{
return sprintf('%s::%s', $className, $constantName);
}
}