From 4d317d61ab05f8a39fa4ba13148f43ad2da4e832 Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 1 Oct 2023 16:26:10 -0400 Subject: [PATCH] Removed unused Constants.php --- Makefile | 1 - src/ncc/Runtime/Constants.php | 118 ---------------------------------- 2 files changed, 119 deletions(-) delete mode 100644 src/ncc/Runtime/Constants.php diff --git a/Makefile b/Makefile index 163a8fa..3b542d4 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,6 @@ $(SRC_PATH)/ncc/autoload_spl.php: $(SRC_PATH)/ncc/Interfaces \ $(SRC_PATH)/ncc/Managers \ $(SRC_PATH)/ncc/Objects \ - $(SRC_PATH)/ncc/Runtime \ $(SRC_PATH)/ncc/Utilities \ $(SRC_PATH)/ncc/ncc.php \ $(SRC_PATH)/ncc/Runtime.php diff --git a/src/ncc/Runtime/Constants.php b/src/ncc/Runtime/Constants.php deleted file mode 100644 index ed6021d..0000000 --- a/src/ncc/Runtime/Constants.php +++ /dev/null @@ -1,118 +0,0 @@ -setValue($value, $readonly); - return; - } - - self::$constants[$constant_hash] = new Constant($scope, $name, $value, $readonly); - } - - /** - * Deletes the constant - * - * @param string $scope - * @param string $name - * @return void - * @throws IntegrityException - */ - public static function delete(string $scope, string $name): void - { - if(!Validate::constantName($name)) - { - return; - } - - $constant_hash = Resolver::resolveConstantHash($scope, $name); - - if(isset(self::$constants[$constant_hash]) && self::$constants[$constant_hash]->isReadonly()) - { - throw new IntegrityException('Cannot delete the constant \'' . self::$constants[$constant_hash]->getFullName() . '\', constant is readonly'); - } - - unset(self::$constants[$constant_hash]); - } - - /** - * Gets the constant - * - * @param string $scope - * @param string $name - * @return string|null - */ - public static function get(string $scope, string $name): ?string - { - if(!Validate::constantName($name)) - { - return null; - } - - $constant_hash = Resolver::resolveConstantHash($scope, $name); - - if(isset(self::$constants[$constant_hash])) - { - return self::$constants[$constant_hash]->getValue(); - } - - return null; - } - } \ No newline at end of file