From 87a8ca24a1260690fc5bfe55e8906ecb25d96015 Mon Sep 17 00:00:00 2001 From: netkas Date: Sat, 14 Sep 2024 08:35:16 -0400 Subject: [PATCH] Convert BuildConstants constants to enum cases --- src/ncc/Classes/NccExtension/ConstantCompiler.php | 8 ++++---- src/ncc/Enums/SpecialConstants/BuildConstants.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ncc/Classes/NccExtension/ConstantCompiler.php b/src/ncc/Classes/NccExtension/ConstantCompiler.php index f551657..3ecb5b3 100644 --- a/src/ncc/Classes/NccExtension/ConstantCompiler.php +++ b/src/ncc/Classes/NccExtension/ConstantCompiler.php @@ -121,10 +121,10 @@ return str_replace( [ - BuildConstants::COMPILE_TIMESTAMP, - BuildConstants::NCC_BUILD_VERSION, - BuildConstants::NCC_BUILD_FLAGS, - BuildConstants::NCC_BUILD_BRANCH + BuildConstants::COMPILE_TIMESTAMP->value, + BuildConstants::NCC_BUILD_VERSION->value, + BuildConstants::NCC_BUILD_FLAGS->value, + BuildConstants::NCC_BUILD_BRANCH->value ], [ time(), diff --git a/src/ncc/Enums/SpecialConstants/BuildConstants.php b/src/ncc/Enums/SpecialConstants/BuildConstants.php index cd7f66d..21ebbd3 100644 --- a/src/ncc/Enums/SpecialConstants/BuildConstants.php +++ b/src/ncc/Enums/SpecialConstants/BuildConstants.php @@ -22,25 +22,25 @@ namespace ncc\Enums\SpecialConstants; - final class BuildConstants + enum BuildConstants : string { /** * The Unix Timestamp for when the package was compiled */ - public const COMPILE_TIMESTAMP = '%COMPILE_TIMESTAMP%'; + case COMPILE_TIMESTAMP = '%COMPILE_TIMESTAMP%'; /** * The version of NCC that was used to compile the package */ - public const NCC_BUILD_VERSION = '%NCC_BUILD_VERSION%'; + case NCC_BUILD_VERSION = '%NCC_BUILD_VERSION%'; /** * NCC Build Flags exploded into spaces */ - public const NCC_BUILD_FLAGS = '%NCC_BUILD_FLAGS%'; + case NCC_BUILD_FLAGS = '%NCC_BUILD_FLAGS%'; /** * NCC Build Branch */ - public const NCC_BUILD_BRANCH = '%NCC_BUILD_BRANCH%'; + case NCC_BUILD_BRANCH = '%NCC_BUILD_BRANCH%'; } \ No newline at end of file