From e3128c4a9a67b65afd5a595019db4fb1bd4997b7 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Thu, 2 May 2024 09:21:25 +1000 Subject: [PATCH] adding enum for semconv versions --- script/semantic-conventions/semconv.sh | 2 +- src/SemConv/Version.php | 20 ++++++++++++++++++++ tests/Unit/SemConv/VersionTest.php | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/SemConv/Version.php create mode 100644 tests/Unit/SemConv/VersionTest.php diff --git a/script/semantic-conventions/semconv.sh b/script/semantic-conventions/semconv.sh index 1752c066d..b1d414bef 100755 --- a/script/semantic-conventions/semconv.sh +++ b/script/semantic-conventions/semconv.sh @@ -36,7 +36,7 @@ git reset --hard FETCH_HEAD cd "${SCRIPT_DIR}" mkdir -p "${CODE_DIR}" -find "${CODE_DIR}" -name "*.php" -exec rm -f {} \; +find "${CODE_DIR}" -name "*.php" ! -name "Version.php" -exec rm -f {} \; # Trace docker run --rm \ diff --git a/src/SemConv/Version.php b/src/SemConv/Version.php new file mode 100644 index 000000000..5d2acc84d --- /dev/null +++ b/src/SemConv/Version.php @@ -0,0 +1,20 @@ +value; + } +} diff --git a/tests/Unit/SemConv/VersionTest.php b/tests/Unit/SemConv/VersionTest.php new file mode 100644 index 000000000..b3a333679 --- /dev/null +++ b/tests/Unit/SemConv/VersionTest.php @@ -0,0 +1,19 @@ +url(); + $this->assertSame('https://opentelemetry.io/schemas/1.25.0', $url); + } +}