diff --git a/.gitignore b/.gitignore index fc61b884..25d0a69b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,10 +12,10 @@ Thumbs.db # Composer dependencies resolver composer.lock -# PHAR artifacts -/phar/** -!/phar/*.phar -!/phar/*.phar.pubkey +# Distribution artifacts +/dist/** +!/dist/*.phar +!/dist/*.phar.pubkey # Storage folder for runtime-generated files /storage/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fa61a53..727024b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v0.3.3](https://github.com/The-FireHub-Project/Core-Foundation/compare/v0.3.2...v0.3.3) – 2026-05-28 + +### Added +- Add `Map` and `Associative` data structures with advanced capabilities (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`15b5c3a`](https://github.com/The-FireHub-Project/Core-Foundation/commit/15b5c3a)) +- Add `crc32` checksum calculation to `StrSB` with unit test coverage (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`15b5c3a`](https://github.com/The-FireHub-Project/Core-Foundation/commit/15b5c3a)) + +### Changed +- Replace `ArrMapStorage` with new `HashStorage` abstraction; introduce pluggable `HashEngine` and remove outdated array-based initializers (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`b430fe0`](https://github.com/The-FireHub-Project/Core-Foundation/commit/b430fe0)) + +### Fixed +- Replace `addFirst` with `addLast` in `Vector` initialization logic (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`377be90`](https://github.com/The-FireHub-Project/Core-Foundation/commit/377be90)) + +## [v0.3.2](https://github.com/The-FireHub-Project/Core-Foundation/compare/v0.3.1...v0.3.2) – 2026-05-27 + +### Added +- Introduce Data Transfer Object and Rehydratable capabilities for structured data management (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`1117c8b`](https://github.com/The-FireHub-Project/Core-Foundation/commit/1117c8b)) +- Add Rebuildable and Convertible capabilities to data structures (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`cc098de`](https://github.com/The-FireHub-Project/Core-Foundation/commit/cc098de)) +- Enhance `Vector` capabilities with advanced index-based operations and PHP 8.1 support (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`a8db5c5`](https://github.com/The-FireHub-Project/Core-Foundation/commit/a8db5c5)) + +### Fixed +- Correct documentation and improve mutation outcome handling in BackInsertion and ArrListStorage (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`16353ce`](https://github.com/The-FireHub-Project/Core-Foundation/commit/16353ce)) + +## [v0.3.1](https://github.com/The-FireHub-Project/Core-Foundation/compare/v0.3.0...v0.3.1) – 2026-05-25 + +### Added +- Introduce an extensible data structure framework with granular capabilities and runtime state management (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`0400d2e`](https://github.com/The-FireHub-Project/Core-Foundation/commit/0400d2e)) + +## [v0.3.0](https://github.com/The-FireHub-Project/Core-Foundation/compare/v0.2.0...v0.3.0) – 2026-05-19 + +### Added +- Redesign and expand data structure capabilities with flexible abstraction contracts (issue: [#11](https://github.com/The-FireHub-Project/Core-Foundation/issues/11), pr: [#13](https://github.com/The-FireHub-Project/Core-Foundation/pull/13), commit: [`ce61610`](https://github.com/The-FireHub-Project/Core-Foundation/commit/ce61610)) + ## [v0.2.0](https://github.com/The-FireHub-Project/Core-Foundation/compare/v0.1.1...v0.2.0) – 2026-03-23 ### Added diff --git a/CITATION.cff b/CITATION.cff index 250f3dce..5522c44b 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,8 +4,8 @@ title: The FireHub Project - Core Foundation abstract: The essential PHP core for clean, domain-driven architecture. type: software license: Apache-2.0 -version: v0.2.0 -date-released: 2026-03-23 +version: v0.3.1 +date-released: 2026-05-25 url: "https://the-firehub-project.github.io/core-foundation" repository-code: "https://github.com/The-FireHub-Project/Core-Foundation" diff --git a/README.md b/README.md index c372e95a..6dd695a0 100644 --- a/README.md +++ b/README.md @@ -3,137 +3,140 @@

release version GitHub license

-## FireHub Core Foundation — Develop Branch +## High-level API for Low-level proxy – Development Branch

- + PHPStan + + PHPUnit +

+ +

+ + GitHub last commit (branch) - + GitHub activity (branch) - + GitHub commit difference between two branches

-⚠️ **This is the `develop` branch** +### Pull request -- Unstable -- APIs may change without notice -- Not intended for production use - -## Branch Purpose - -The `develop` branch is the **primary integration branch** for all ongoing development. - -It serves as the staging area where: -- Feature branches are merged -- Bug fixes are integrated -- Experimental work is stabilized -- Code is prepared for upcoming releases - -All **release branches** are created **from `develop`**. - -## Stability Guarantee +

+ + GitHub pull request title + + GitHub pull request author + + GitHub pull request created + + GitHub pull request comments +

-❌ No backward compatibility guarantee -❌ APIs may change without notice -❌ Behavior may be incomplete or inconsistent -❌ Breaking changes are expected +### Milestone -This branch is intended **only for contributors and advanced testers**. +

+ + GitHub milestone details +

-## Versioning Strategy +This branch contains the initial development of foundational internal utilities for **FireHub Core Foundation**. -FireHub follows **Semantic Versioning (SemVer)**: +The purpose of this branch is to establish a stable, consistent, and reusable internal layer that standardizes access to core PHP functionality and provides safe, predictable building blocks for higher-level components across the FireHub ecosystem. -MAJOR.MINOR.PATCH +## Purpose -### Pre-release versions +Introduce high-level support classes like `Str` and `Collection` in Core-Foundation. +These classes will provide a clean, object-oriented API on top of the existing low-level PHP proxy functions, enabling developers to work with strings and collections more intuitively and safely. -Pre-release versions are tagged **only on release branches**, never directly on `develop`. +- `Str` will wrap common string operations (manipulation, formatting, encoding) in a fluent, high-level interface. +- `Collection` will provide an object-oriented wrapper for arrays and iterable structures, with functional utilities like map, filter, reduce, and chaining. -Examples: -- `v0.1.0-alpha.1` -- `v0.1.0-beta.1` -- `v0.1.0-rc.1` +This layer sits above the low-level proxies, ensuring consistency, testability, and reusability across FireHub modules. -The `develop` branch itself is considered **pre-release by definition**. +## Scope -## Branch Workflow +This branch includes: -### Main branches +- Internal utility and support classes +- Low-level abstractions intended for framework-internal use +- Namespaced, final, static-style helpers designed for performance and predictability -| Branch | Purpose | -|-----------------|-----------------------------------------| -| `master` | Production-ready, stable releases only | -| `develop` | Active development & integration | -| `release/x.y.z` | Release preparation & stabilization | -| `vX.y.z` | Maintenance branches for older versions | +Out of scope for this branch: -### Supporting branches +- Public-facing APIs +- High-level domain abstractions +- Framework features or adapters +- Tooling (tests, PHAR, CI pipelines) -| Branch | Purpose | -|-----------------|-----------------------------------| -| `feature/*` | New features | -| `bugfix/*` | Bug fixes | -| `patch/*` | Patch | -| `hotfix/*` | Critical fixes for production | -| `experiment/*` | Prototypes and experiments | -| `feature/*` | Feature branch | -| `integration/*` | Temp branch for multiple features | -| `wip/*` | Temporary work-in-progress | +## Stability & Compatibility -## Merging rules +- Changes are internal and backward compatible +- No public contracts are introduced or modified +- Safe for reuse across all Core distributions -- bugfix/* → develop -- patch/* → develop -- hotfix/* → master → develop -> vX.y.z -- experiment/* → develop (only if promoted) -- feature/* → develop -- integration/* → develop -- release/* → master (stable only) +## Workflow -❌ Direct commits to develop are discouraged -✅ Pull requests with review are required +- Development happens exclusively on this feature branch +- All work is tracked via a single feature issue +- The branch will be merged into `develop` once the scope is complete +- The merge marks the completion of the `v0.3.0` milestone -## Composer Usage (Not Recommended) -For internal testing only: +## Related -```json -{ - "require": { - "firehub/core-foundation": "dev-develop" - } -} -``` -⚠️ Never use dev-develop in production. +- Milestone: **Development v1** +- Target Release: **v0.3.0** +- Repository: FireHub Core Foundation ## FireHub Icon License This software is licensed under the Apache-2.0 License. -For more details, read the full license [here](./LICENSE). +For more details, read the full license [here](./LICENSE). \ No newline at end of file diff --git a/composer.json b/composer.json index a2b2cf15..e2b4d5fa 100644 --- a/composer.json +++ b/composer.json @@ -7,18 +7,15 @@ "license": "Apache-2.0", "require": { "php": "^8.5", + "ext-openssl": "*", "ext-mbstring": "*" }, "require-dev": { "phpstan/phpstan": "^2.0", "phpstan/phpstan-strict-rules": "^2.0", + "firehub/phpstan-rules": "^1.0", "phpunit/phpunit": "^13.0" }, - "autoload-dev": { - "psr-4": { - "FireHub\\PHPStan\\": "phpstan/" - } - }, "minimum-stability": "dev", "prefer-stable": true, "authors": [ diff --git a/dist/core.min.phar b/dist/core.min.phar new file mode 100644 index 00000000..ede04138 Binary files /dev/null and b/dist/core.min.phar differ diff --git a/dist/core.min.phar.pubkey b/dist/core.min.phar.pubkey new file mode 100644 index 00000000..c7b78e2e --- /dev/null +++ b/dist/core.min.phar.pubkey @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0IDxH1kkgj+hINvM/oMR +w0CINronO5r+c2JWx52MrmdZw98TgMsu29XYXX92Vq6RuoVQxU9BHXZLEeeTdlJZ +yJ8RPUM+FoKF0IfyvtUcd6P0r/Fuy6W2oAHYz9gF/Jo9OYK0gWAjf/LakLjY4BkD +VntFcK0REXVPb88nbXk8HRTCP2cAEZU9YKopD7Q1Thq0lRRy0QSXT9E/sG4C9w9r +mGXoTtfSB3qMkSZ4hrWkYLXeEoNVivLfOIjPv/hvHTl/kwZKFHr2Hyz/zsBREnw2 +cZfwpjdL3pNtvIonfDNbI7mDPw9joPMfpapk5BapoYyBZDuTETOC/5nw2RiX5F2n ++7THEK1u3YCqqPwVT9dWxGhH0+wcvs1QfBEcCBSXOBiFlvcw5y3yIPlwFUloDuN+ +hUn6GV68FhbKYBRUop9JhVLG/3/FCENfk7bm3vMDdWSkNWBnKt1s2LbRK4M6oBYG +3/6xfS91zhh7XQsJvZpD6AxpsJx/50ailmgheLdycGaeflqpawC+L/fkTusOyjM1 +TKHHPKIKCieaeOW+bI1jaeKAmJuZGRouYun8No7S9ybS58Z/xjGrbLC2fjKRrRTE +EBHb+o66gXTecCgNcSs0LmGkBLAsNL5HxhOk67GQexStuiTaAp4wjGuEPG1vQSQG ++dx6NDW9JrFPud0MgwRKTV8CAwEAAQ== +-----END PUBLIC KEY----- diff --git a/phar/core.phar b/dist/core.phar similarity index 72% rename from phar/core.phar rename to dist/core.phar index ea5410e2..d7f6964c 100644 Binary files a/phar/core.phar and b/dist/core.phar differ diff --git a/dist/core.phar.pubkey b/dist/core.phar.pubkey new file mode 100644 index 00000000..c7b78e2e --- /dev/null +++ b/dist/core.phar.pubkey @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0IDxH1kkgj+hINvM/oMR +w0CINronO5r+c2JWx52MrmdZw98TgMsu29XYXX92Vq6RuoVQxU9BHXZLEeeTdlJZ +yJ8RPUM+FoKF0IfyvtUcd6P0r/Fuy6W2oAHYz9gF/Jo9OYK0gWAjf/LakLjY4BkD +VntFcK0REXVPb88nbXk8HRTCP2cAEZU9YKopD7Q1Thq0lRRy0QSXT9E/sG4C9w9r +mGXoTtfSB3qMkSZ4hrWkYLXeEoNVivLfOIjPv/hvHTl/kwZKFHr2Hyz/zsBREnw2 +cZfwpjdL3pNtvIonfDNbI7mDPw9joPMfpapk5BapoYyBZDuTETOC/5nw2RiX5F2n ++7THEK1u3YCqqPwVT9dWxGhH0+wcvs1QfBEcCBSXOBiFlvcw5y3yIPlwFUloDuN+ +hUn6GV68FhbKYBRUop9JhVLG/3/FCENfk7bm3vMDdWSkNWBnKt1s2LbRK4M6oBYG +3/6xfS91zhh7XQsJvZpD6AxpsJx/50ailmgheLdycGaeflqpawC+L/fkTusOyjM1 +TKHHPKIKCieaeOW+bI1jaeKAmJuZGRouYun8No7S9ybS58Z/xjGrbLC2fjKRrRTE +EBHb+o66gXTecCgNcSs0LmGkBLAsNL5HxhOk67GQexStuiTaAp4wjGuEPG1vQSQG ++dx6NDW9JrFPud0MgwRKTV8CAwEAAQ== +-----END PUBLIC KEY----- diff --git a/phar/core.min.phar b/phar/core.min.phar deleted file mode 100644 index 4b6b72fa..00000000 Binary files a/phar/core.min.phar and /dev/null differ diff --git a/phar/core.min.phar.pubkey b/phar/core.min.phar.pubkey deleted file mode 100644 index a4c4ad24..00000000 --- a/phar/core.min.phar.pubkey +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAl2Cl9wpddZ6U45qE7GpV -xmrmWKwll34ApLrWiiaMkOFz/swgjX4SlTIDXoeaWDjUZqIScgIC+GU2DFNahLrS -+2uzjXXPwh4cybJH3o/iCz710mk7oNVweJoDsTukGB8mTH91Op4XSxQGfZeHWQF1 -zvCZy6UNcQD+6BeHIE0hzJlzD4pvfJbkxABPDBAU92w2a5fWQ/k0eh4djWpUULG0 -mBgTdVRDlFyyzjPyLxuB5XtkmMmv4ByVqUHQccPhFikv3kpnR1jqeHLvwMARnFc/ -XwureYAX4PwjJrGg1c2P2OPlBeHE0JjHOCpj2o12bM65PTrfLIaGmkmUsjHaQh3B -zTPoxE5mVIxn6LSiAh3k7HwGg4tmpuELyHgVblSP+HyUWDj4HLzUxHyP4BiceusZ -d5HPx3Wc7s3hRlH8gMrSyleGD6Im8ecBvFKFiWDSqIiqIV1pUBlIKHkckfFkWYeZ -W+piWgGwJlYc270Fitl7e2XJ7Vq9bDf26sqeyINA8KbqRn9yeQn6v1cQsd0fIObC -sngASw7/nEHS8GOml0BfJaJmviQO/BItfJDl0sLPmZX7fIiI/51gxFCaJtyqany9 -ak8mmSp2zbechnWBUMPEPf7pddz9KH7Rli3OHmcT81PDAl+sumF2f/DcobTz5PM/ -YuRzBylkXVSUdrlugFSDv88CAwEAAQ== ------END PUBLIC KEY----- \ No newline at end of file diff --git a/phar/core.phar.pubkey b/phar/core.phar.pubkey deleted file mode 100644 index a4c4ad24..00000000 --- a/phar/core.phar.pubkey +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAl2Cl9wpddZ6U45qE7GpV -xmrmWKwll34ApLrWiiaMkOFz/swgjX4SlTIDXoeaWDjUZqIScgIC+GU2DFNahLrS -+2uzjXXPwh4cybJH3o/iCz710mk7oNVweJoDsTukGB8mTH91Op4XSxQGfZeHWQF1 -zvCZy6UNcQD+6BeHIE0hzJlzD4pvfJbkxABPDBAU92w2a5fWQ/k0eh4djWpUULG0 -mBgTdVRDlFyyzjPyLxuB5XtkmMmv4ByVqUHQccPhFikv3kpnR1jqeHLvwMARnFc/ -XwureYAX4PwjJrGg1c2P2OPlBeHE0JjHOCpj2o12bM65PTrfLIaGmkmUsjHaQh3B -zTPoxE5mVIxn6LSiAh3k7HwGg4tmpuELyHgVblSP+HyUWDj4HLzUxHyP4BiceusZ -d5HPx3Wc7s3hRlH8gMrSyleGD6Im8ecBvFKFiWDSqIiqIV1pUBlIKHkckfFkWYeZ -W+piWgGwJlYc270Fitl7e2XJ7Vq9bDf26sqeyINA8KbqRn9yeQn6v1cQsd0fIObC -sngASw7/nEHS8GOml0BfJaJmviQO/BItfJDl0sLPmZX7fIiI/51gxFCaJtyqany9 -ak8mmSp2zbechnWBUMPEPf7pddz9KH7Rli3OHmcT81PDAl+sumF2f/DcobTz5PM/ -YuRzBylkXVSUdrlugFSDv88CAwEAAQ== ------END PUBLIC KEY----- \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index beda53bc..1486efd6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,17 +1,13 @@ includes: - phar://phpstan.phar/conf/bleedingEdge.neon - vendor/phpstan/phpstan-strict-rules/rules.neon - - phpstan/rule.neon - - phpstan/type.neon + - vendor/firehub/phpstan-rules/rule.neon + - vendor/firehub/phpstan-rules/type.neon parameters: level: max paths: - src/ - - phpstan/ - excludePaths: - analyse: - - phpstan/** tmpDir: storage/cache/phpstan/ ignoreErrors: - identifier: ternary.shortNotAllowed diff --git a/phpstan/Rule/NoNativeFunctionsRule.php b/phpstan/Rule/NoNativeFunctionsRule.php deleted file mode 100644 index ee90c1ed..00000000 --- a/phpstan/Rule/NoNativeFunctionsRule.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @copyright 2026 The FireHub Project - All rights reserved - * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 - * - * @php-version 7.4 - * @package Core\PHPStan - * - * @version GIT: $Id$ Blob checksum. - */ - -namespace FireHub\PHPStan\Rule; - -use PhpParser\ { - Node, Node\Expr\FuncCall -}; -use PHPStan\Analyser\Scope; -use PHPStan\Rules\ { - Rule, RuleErrorBuilder -}; -use PHPStan\Reflection\ReflectionProvider; - -/** - * ### Rule that forbids direct usage of native functions - * @since 1.0.0 - * - * @template TNodeType of Node - * - * @implements Rule - */ -final class NoNativeFunctionsRule implements Rule { - - /** - * ## Constructor - * @since 1.0.0 - * - * @param \PHPStan\Reflection\ReflectionProvider $reflectionProvider

- * Reflection provider for class hierarchy checks. - *

- * - * @return void - */ - public function __construct( - private ReflectionProvider $reflectionProvider - ) {} - - /** - * ### Returns the node type this rule is interested in - * @since 1.0.0 - * - * @return class-string All function calls. - */ - public function getNodeType ():string { - - return FuncCall::class; - - } - - /** - * ### Process the node - * @since 1.0.0 - * - * @param TNodeType $node

- * The node. - *

- * @param \PHPStan\Analyser\Scope&\PHPStan\Analyser\NodeCallbackInvoker $scope

- * The scope. - *

- * - * @throws \PHPStan\ShouldNotHappenException If error occurs. - * - * @return array{\PHPStan\Rules\RuleError} Error messages. - */ - public function processNode (Node $node, Scope $scope):array { - - $classReflection = $scope->getClassReflection(); - - if ( - $classReflection !== null && - $classReflection->isSubclassOfClass($this->reflectionProvider - ->getClass(\FireHub\Core\Support\LowLevel::class)) - ) { - return []; - } - - if (!$node instanceof FuncCall) return []; - - $name = $node->name; - - if ($name instanceof Node\Name) { - - $funcName = strtolower((string)$name); - - $list = array_values( - array_diff( - get_defined_functions()['internal'], - [ - 'func_num_args', - 'func_get_arg', - 'func_get_args', - ] - ) - ); - - if (in_array($funcName, $list, true)) { - - return [ - RuleErrorBuilder::message(sprintf( - 'Do not use native function %s(), use FireHub LowLevel wrapper instead.', - $funcName - ))->build() - ]; - - } - - } - - return []; - - } -} \ No newline at end of file diff --git a/phpstan/Type/MathMaxReturnTypeExtension.php b/phpstan/Type/MathMaxReturnTypeExtension.php deleted file mode 100644 index 2fbd44aa..00000000 --- a/phpstan/Type/MathMaxReturnTypeExtension.php +++ /dev/null @@ -1,130 +0,0 @@ - - * @copyright 2026 The FireHub Project - All rights reserved - * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 - * - * @php-version 7.4 - * @package Core\PHPStan - * - * @version GIT: $Id$ Blob checksum. - */ - -namespace FireHub\PHPStan\Type; - -use FireHub\Core\Support\LowLevel\Math; -use PhpParser\Node\ { - Arg, Expr\StaticCall -}; -use PHPStan\Analyser\Scope; -use PHPStan\Reflection\MethodReflection; -use PHPStan\Type\ { - Constant\ConstantBooleanType, ConstantTypeHelper, DynamicStaticMethodReturnTypeExtension, FloatType, - IntegerRangeType, IntegerType, MixedType, Type, TypeCombinator -}; -use Throwable; - -/** - * ### Extends PHPStan's `max()` function to support constant folding - * @since 1.0.0 - */ -final class MathMaxReturnTypeExtension implements DynamicStaticMethodReturnTypeExtension { - - /** - * ### Returns the class name - * @since 1.0.0 - * - * @return class-string Class FQN. - */ - public function getClass ():string { - - return Math::class; - - } - - /** - * ### Returns whether the method is supported - * @since 1.0.0 - * - * @param \PHPStan\Reflection\MethodReflection $methodReflection

- * The method reflection instance. - *

- * - * @return bool True if the method is supported. - */ - public function isStaticMethodSupported (MethodReflection $methodReflection): bool { - - return $methodReflection->getName() === 'max'; - - } - - /** - * ### Returns the type of the method - * @since 1.0.0 - * - * @param \PHPStan\Reflection\MethodReflection $methodReflection

- * The method reflection instance. - *

- * @param \PhpParser\Node\Expr\StaticCall $methodCall

- * The method call node. - *

- * @param \PHPStan\Analyser\Scope $scope

- * The current scope. - *

- * - * @return \PHPStan\Type\Type The type. - */ - public function getTypeFromStaticMethodCall (MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope):Type { - - $types = []; - - foreach ($methodCall->args as $arg) - if ($arg instanceOf Arg) - $types[] = $scope->getType($arg->value); - - if ($types === []) return new MixedType(); - - $values = null; - foreach ($types as $type) { - - foreach ($type->getConstantScalarValues() as $value) - $values[] = $value; - - } - - if ($values !== null) { - - try { - - $max = max(...$values); - - return ConstantTypeHelper::getTypeFromValue($max); - - } catch (Throwable) {} - - } - - $result = TypeCombinator::union(...$types); - - if ( - $result->isSuperTypeOf(new IntegerType())->yes() - || $result->isSuperTypeOf(new FloatType())->yes() - ) { - - TypeCombinator::remove( - $result, - new ConstantBooleanType(false) - ); - - $result = IntegerRangeType::fromInterval(0, null); - - } - - return $result; - - } - -} \ No newline at end of file diff --git a/phpstan/Type/MathMinReturnTypeExtension.php b/phpstan/Type/MathMinReturnTypeExtension.php deleted file mode 100644 index d0370c62..00000000 --- a/phpstan/Type/MathMinReturnTypeExtension.php +++ /dev/null @@ -1,130 +0,0 @@ - - * @copyright 2026 The FireHub Project - All rights reserved - * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 - * - * @php-version 7.4 - * @package Core\PHPStan - * - * @version GIT: $Id$ Blob checksum. - */ - -namespace FireHub\PHPStan\Type; - -use FireHub\Core\Support\LowLevel\Math; -use PhpParser\Node\ { - Arg, Expr\StaticCall -}; -use PHPStan\Analyser\Scope; -use PHPStan\Reflection\MethodReflection; -use PHPStan\Type\ { - Constant\ConstantBooleanType, ConstantTypeHelper, DynamicStaticMethodReturnTypeExtension, FloatType, - IntegerRangeType, IntegerType, MixedType, Type, TypeCombinator -}; -use Throwable; - -/** - * ### Extends PHPStan's `min()` function to support constant folding - * @since 1.0.0 - */ -final class MathMinReturnTypeExtension implements DynamicStaticMethodReturnTypeExtension { - - /** - * ### Returns the class name - * @since 1.0.0 - * - * @return class-string Class FQN. - */ - public function getClass ():string { - - return Math::class; - - } - - /** - * ### Returns whether the method is supported - * @since 1.0.0 - * - * @param \PHPStan\Reflection\MethodReflection $methodReflection

- * The method reflection instance. - *

- * - * @return bool True if the method is supported. - */ - public function isStaticMethodSupported (MethodReflection $methodReflection): bool { - - return $methodReflection->getName() === 'min'; - - } - - /** - * ### Returns the type of the method - * @since 1.0.0 - * - * @param \PHPStan\Reflection\MethodReflection $methodReflection

- * The method reflection instance. - *

- * @param \PhpParser\Node\Expr\StaticCall $methodCall

- * The method call node. - *

- * @param \PHPStan\Analyser\Scope $scope

- * The current scope. - *

- * - * @return \PHPStan\Type\Type The type. - */ - public function getTypeFromStaticMethodCall (MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope):Type { - - $types = []; - - foreach ($methodCall->args as $arg) - if ($arg instanceOf Arg) - $types[] = $scope->getType($arg->value); - - if ($types === []) return new MixedType(); - - $values = null; - foreach ($types as $type) { - - foreach ($type->getConstantScalarValues() as $value) - $values[] = $value; - - } - - if ($values !== null) { - - try { - - $min = min(...$values); - - return ConstantTypeHelper::getTypeFromValue($min); - - } catch (Throwable) {} - - } - - $result = TypeCombinator::union(...$types); - - if ( - $result->isSuperTypeOf(new IntegerType())->yes() - || $result->isSuperTypeOf(new FloatType())->yes() - ) { - - TypeCombinator::remove( - $result, - new ConstantBooleanType(false) - ); - - $result = IntegerRangeType::fromInterval(0, null); - - } - - return $result; - - } - -} \ No newline at end of file diff --git a/phpstan/rule.neon b/phpstan/rule.neon deleted file mode 100644 index eeca4a1b..00000000 --- a/phpstan/rule.neon +++ /dev/null @@ -1,4 +0,0 @@ -services: - - class: FireHub\PHPStan\Rule\NoNativeFunctionsRule - tags: - - phpstan.rules.rule \ No newline at end of file diff --git a/phpstan/type.neon b/phpstan/type.neon deleted file mode 100644 index f53a04e5..00000000 --- a/phpstan/type.neon +++ /dev/null @@ -1,7 +0,0 @@ -services: - - class: FireHub\PHPStan\Type\MathMaxReturnTypeExtension - tags: - - phpstan.broker.dynamicStaticMethodReturnTypeExtension - - class: FireHub\PHPStan\Type\MathMinReturnTypeExtension - tags: - - phpstan.broker.dynamicStaticMethodReturnTypeExtension \ No newline at end of file diff --git a/src/domain/autoload/firehub.Handle.php b/src/domain/autoload/firehub.Handle.php index c8fba260..29004310 100644 --- a/src/domain/autoload/firehub.Handle.php +++ b/src/domain/autoload/firehub.Handle.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Domain - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Domain\Autoload; diff --git a/src/firehub.FireHub.php b/src/firehub.FireHub.php index c4c5a68e..b3ddd6c4 100644 --- a/src/firehub.FireHub.php +++ b/src/firehub.FireHub.php @@ -9,15 +9,13 @@ * * @php-version 8.4 * @package Core - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core; use FireHub\Core\Support\Bootstrap\FireHubConfigurator; use FireHub\Core\Support\Bootstrap\Bootloader; -use FireHub\Core\Throwable\Exception\Bootstrap\ { +use FireHub\Core\Throwable\Exception\Support\Bootstrap\ { FailedToLoadBootloaderException, NotBootloaderException }; use FireHub\Core\Support\LowLevel\ { @@ -59,9 +57,10 @@ final class FireHub { * FireHub configurator. *

* - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException If a bootloader fails to - * load. - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException If a bootloader is not a bootloader. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException If a bootloader + * fails to load. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException If a bootloader is not + * a bootloader. * * @return void */ @@ -96,9 +95,11 @@ public function boot ():string { * @uses \FireHub\Core\Support\LowLevel\ClsObj::ofClass() To check if the $value is a bootloader. * @uses \FireHub\Core\Support\Bootstrap\Bootloader::boot() To boot a bootloader. * - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException If a bootloader fails to - * load. - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException If a bootloader is not a bootloader. + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException If a bootloader + * fails to load. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException If a bootloader is not + * a bootloader. * * @return void */ @@ -108,17 +109,20 @@ private function loadBootloaders ():void { match (true) { DataIs::string($key) && DataIs::array($value) && ClsObj::ofClass($key, Bootloader::class) => new $key(...$value)->boot() - ?: FailedToLoadBootloaderException::builder() + ?: throw FailedToLoadBootloaderException::builder() ->withContext(['class' => $key]) - ->throw(), + ->build(), DataIs::string($value) && ClsObj::ofClass($value, Bootloader::class) => new $value()->boot() - ?: FailedToLoadBootloaderException::builder() + ?: throw FailedToLoadBootloaderException::builder() ->withContext(['class' => $value]) - ->throw(), - default => NotBootloaderException::builder() - ->withContext(['bootloader' => '']) - ->throw() + ->build(), + default => throw NotBootloaderException::builder() + ->withContext([ + 'key' => $key, + 'value' => $value + ]) + ->build() }; } diff --git a/src/public/boot.php b/src/public/boot.php index 57d187c8..58f7a5a8 100644 --- a/src/public/boot.php +++ b/src/public/boot.php @@ -12,11 +12,12 @@ * * @php-version 7.0 * @package Core\Public - * - * @version GIT: $Id$ Blob checksum. */ -namespace FireHub\Public; +namespace FireHub\Core\Public; + +/** ### Register the Composer autoloader */ +require __DIR__.'/../../vendor/autoload.php'; require __DIR__ . '/index.php'; @@ -26,9 +27,10 @@ * ### Let there be light * @since 1.0.0 * - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException If a bootloader fails to - * load. - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException If a bootloader is not a bootloader. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException If a bootloader + * fails to load. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException If a bootloader is not + * a bootloader. * * @return \FireHub\Core\FireHub */ diff --git a/src/public/index.php b/src/public/index.php index 89289757..24c76c4f 100644 --- a/src/public/index.php +++ b/src/public/index.php @@ -12,11 +12,9 @@ * * @php-version 7.0 * @package Core\Public - * - * @version GIT: $Id$ Blob checksum. */ -namespace FireHub\Public; +namespace FireHub\Core\Public; require __DIR__.'/../support/firehub.LowLevel.php'; require __DIR__.'/../support/firehub.Autoload.php'; diff --git a/src/shared/constants/firehub.Number.php b/src/shared/constants/firehub.Number.php index f5ee6220..f5f02cdc 100644 --- a/src/shared/constants/firehub.Number.php +++ b/src/shared/constants/firehub.Number.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Constants\Number; diff --git a/src/shared/constants/firehub.Path.php b/src/shared/constants/firehub.Path.php index 4c4b8a50..2402206c 100644 --- a/src/shared/constants/firehub.Path.php +++ b/src/shared/constants/firehub.Path.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Constants\Path; diff --git a/src/shared/contracts/firehub.ArrayConvertable.php b/src/shared/contracts/firehub.ArrayConvertable.php new file mode 100644 index 00000000..32965e8f --- /dev/null +++ b/src/shared/contracts/firehub.ArrayConvertable.php @@ -0,0 +1,44 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +/** + * ### ArrayConstructable interface + * + * Objects that can be created from arrays and can convert themselves to arrays. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @extends \FireHub\Core\Shared\Contracts\Arrayable + */ +interface ArrayConvertable extends Arrayable { + + /** + * ### Create a new object from an array + * + * This static method constructs a new instance of the implementing class using the provided array as its initial + * data storage. + * @since 1.0.0 + * + * @param array $array

+ * Input data for creating the object. + *

+ * + * @return static A new instance of the implementing class. + */ + public static function fromArray (array $array):static; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.Arrayable.php b/src/shared/contracts/firehub.Arrayable.php new file mode 100644 index 00000000..1896b453 --- /dev/null +++ b/src/shared/contracts/firehub.Arrayable.php @@ -0,0 +1,33 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +/** + * ### Represents an object that can be converted into an array representation + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + */ +interface Arrayable { + + /** + * ### Convert object to array + * @since 1.0.0 + * + * @return array Object as an array. + */ + public function toArray ():array; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.Countable.php b/src/shared/contracts/firehub.Countable.php new file mode 100644 index 00000000..9c4654c7 --- /dev/null +++ b/src/shared/contracts/firehub.Countable.php @@ -0,0 +1,34 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +use Countable as InternalCountable; + +/** + * ### Countable contract + * + * Classes implementing Countable can be used with the count() function. + * @since 1.0.0 + */ +interface Countable extends InternalCountable { + + /** + * ### Count elements of an object + * @since 1.0.0 + * + * @return non-negative-int Number of elements of an object. + */ + public function count ():int; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.DataTransferObject.php b/src/shared/contracts/firehub.DataTransferObject.php new file mode 100644 index 00000000..72e3e36c --- /dev/null +++ b/src/shared/contracts/firehub.DataTransferObject.php @@ -0,0 +1,33 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +/** + * ### Data Transfer Object Contract + * + * Defines a strict boundary object used for transferring structured state between data structures, hydration + * pipelines, codecs, and persistence layers. + * + * A DataTransferObject is an immutable representation of a canonical state snapshot. It contains no business logic and + * must not depend on storage, runtime memory layout, or execution context. + * + * It serves as the bridge between: + * - DataStructure (domain logic) + * - Dehydrated state (canonical representation) + * - Codec layer (serialization/encoding) + * - Persistence layer (storage systems) + * + * @since 1.0.0 + */ +interface DataTransferObject {} \ No newline at end of file diff --git a/src/shared/contracts/firehub.Iterator.php b/src/shared/contracts/firehub.Iterator.php new file mode 100644 index 00000000..9a3ee4fd --- /dev/null +++ b/src/shared/contracts/firehub.Iterator.php @@ -0,0 +1,79 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +use Iterator as InternalIterator; + +/** + * ### Base iterator contract + * + * Interface for external iterators or objects that can be iterated themselves internally. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @extends Traversable + * @extends InternalIterator + */ +interface Iterator extends Traversable, InternalIterator { + + /** + * ### Checks if the current position is valid + * @since 1.0.0 + * + * @return bool True on success or false on failure. + * + * @note This method is called after rewind() and next() to check if the current position is valid. + */ + public function valid ():bool; + + /** + * ### Return the current element + * @since 1.0.0 + * + * @return TValue Current element. + */ + public function current ():mixed; + + /** + * ### Return the key of the current element + * @since 1.0.0 + * + * @return null|TKey Key of the current element. + */ + public function key ():mixed; + + /** + * ### Move forward to the next element + * @since 1.0.0 + * + * @return void + * + * @note This method is called after each foreach loop. + */ + public function next ():void; + + /** + * ### Rewind the iterator to the first element + * @since 1.0.0 + * + * @return void + * + * @note This is the first method called when starting a foreach loop. + * It will not be executed after foreach loops. + */ + public function rewind ():void; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.IteratorAggregate.php b/src/shared/contracts/firehub.IteratorAggregate.php new file mode 100644 index 00000000..7c4cc33f --- /dev/null +++ b/src/shared/contracts/firehub.IteratorAggregate.php @@ -0,0 +1,40 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +use IteratorAggregate as InternalIteratorAggregate, Traversable as InternalTraversable; + +/** + * ### Base iterator aggregate contract + * + * Interface for external iterators or objects that can be iterated themselves internally. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @extends Traversable + * @extends InternalIteratorAggregate + */ +interface IteratorAggregate extends Traversable, InternalIteratorAggregate { + + /** + * ### Retrieve an external iterator + * @since 1.0.0 + * + * @return InternalTraversable An instance of an object implementing Iterator or Traversable. + */ + public function getIterator ():InternalTraversable; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.JsonSerializable.php b/src/shared/contracts/firehub.JsonSerializable.php new file mode 100644 index 00000000..facd71e7 --- /dev/null +++ b/src/shared/contracts/firehub.JsonSerializable.php @@ -0,0 +1,61 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +use FireHub\Core\Shared\Enums\Json\ { + Flag, Flag\Encode +}; +use JsonSerializable as InternalJsonSerializable; + +/** + * ### JsonSerializable contract + * + * Objects implementing JsonSerializable can customize their JSON representation when encoded with json_encode() + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + */ +interface JsonSerializable extends InternalJsonSerializable { + + /** + * ### JSON representation of an object + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\Json\Flag As parameter. + * @uses \FireHub\Core\Shared\Enums\Json\Flag\Encode As parameter. + * + * @param positive-int $depth

+ * Set the maximum depth. + *

+ * @param \FireHub\Core\Shared\Enums\Json\Flag|\FireHub\Core\Shared\Enums\Json\Flag\Encode ...$flags

+ * JSON flags. + *

+ * + * @return non-empty-string JSON encoded string. + */ + public function toJson (int $depth = 512, Flag|Encode ...$flags):string; + + /** + * ### Specify data which should be serialized to JSON + * + * Serializes the object to a value that can be serialized natively by json_encode(). + * @since 1.0.0 + * + * @return array Data which can be serialized by json_encode(), which is a value of any type + * other than a resource. + */ + public function jsonSerialize ():array; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.JsonSerializableConvertable.php b/src/shared/contracts/firehub.JsonSerializableConvertable.php new file mode 100644 index 00000000..558d9a88 --- /dev/null +++ b/src/shared/contracts/firehub.JsonSerializableConvertable.php @@ -0,0 +1,52 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +use FireHub\Core\Shared\Enums\Json\ { + Flag, Flag\Decode +}; + +/** + * ### JsonSerializable-convertable object that can be created from and converted to JSON + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @extends \FireHub\Core\Shared\Contracts\JsonSerializable + */ +interface JsonSerializableConvertable extends JsonSerializable { + + /** + * ### Get object from JSON + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\Json\Flag As parameter. + * @uses \FireHub\Core\Shared\Enums\Json\Flag\Decode As parameter. + * + * @param string $json

+ * The JSON string being decoded. + *

+ * @param positive-int $depth [optional]

+ * Set the maximum depth. + *

+ * @param \FireHub\Core\Shared\Enums\Json\Flag|\FireHub\Core\Shared\Enums\Json\Flag\Decode ...$flags

+ * JSON flags. + *

+ * + * @return static This object from JSON encoded parameter. + */ + public static function fromJson (string $json, int $depth = 512, Flag|Decode ...$flags):static; + +} \ No newline at end of file diff --git a/src/shared/contracts/firehub.Throwable.php b/src/shared/contracts/firehub.Throwable.php index 7b3c6f85..431eb89c 100644 --- a/src/shared/contracts/firehub.Throwable.php +++ b/src/shared/contracts/firehub.Throwable.php @@ -9,8 +9,6 @@ * * @php-version 8.0 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Contracts; diff --git a/src/shared/contracts/firehub.Traversable.php b/src/shared/contracts/firehub.Traversable.php new file mode 100644 index 00000000..e2c417dd --- /dev/null +++ b/src/shared/contracts/firehub.Traversable.php @@ -0,0 +1,29 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts; + +use Traversable as InternalTraversable; + +/** + * ### Base traversable contract + * + * Interface to detect if a class is traversable using foreach. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @extends InternalTraversable + */ +interface Traversable extends InternalTraversable {} \ No newline at end of file diff --git a/src/shared/contracts/magic/firehub.Serializable.php b/src/shared/contracts/magic/firehub.Serializable.php new file mode 100644 index 00000000..5746ed24 --- /dev/null +++ b/src/shared/contracts/magic/firehub.Serializable.php @@ -0,0 +1,44 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts\Magic; + +/** + * ### Serializable contract + * + * Contract allows serialization for objects. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + */ +interface Serializable { + + /** + * ### Generates storable representation of an object + * @since 1.0.0 + * + * @return string String containing a byte-stream representation of an object that can be stored anywhere. + */ + public function serialize ():string; + + /** + * ### Construct and return an associative array of key/value pairs that represent the serialized form of the object + * @since 1.0.0 + * + * @return array An associative array of key/value pairs that represent the serialized form + * of the object. + */ + public function __serialize ():array; + +} \ No newline at end of file diff --git a/src/shared/contracts/magic/firehub.SerializableConvertable.php b/src/shared/contracts/magic/firehub.SerializableConvertable.php new file mode 100644 index 00000000..47399378 --- /dev/null +++ b/src/shared/contracts/magic/firehub.SerializableConvertable.php @@ -0,0 +1,54 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.0 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Contracts\Magic; + +/** + * ### Serializable-convertable object that can be serialized and unserialized + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @extends \FireHub\Core\Shared\Contracts\Magic\Serializable + */ +interface SerializableConvertable extends Serializable { + + /** + * ### Creates an object from a stored representation + * @since 1.0.0 + * + * @param non-empty-string $data

+ * The serialized string. + *

+ * @param positive-int $max_depth [optional]

+ * The maximum depth of structures is permitted during unserialization and is intended to prevent stack overflows. + *

+ * + * @return static Object from a serialized parameter. + */ + public static function unserialize (string $data, int $max_depth = 4096):static; + + /** + * ### Converts from serialized data back to the object + * @since 1.0.0 + * + * @param array $data

+ * Serialized data. + *

+ * + * @return void + */ + public function __unserialize (array $data):void; + +} \ No newline at end of file diff --git a/src/shared/contracts/magic/firehub.Stringable.php b/src/shared/contracts/magic/firehub.Stringable.php index 11f0b57a..69f166fc 100644 --- a/src/shared/contracts/magic/firehub.Stringable.php +++ b/src/shared/contracts/magic/firehub.Stringable.php @@ -9,8 +9,6 @@ * * @php-version 8.0 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Contracts\Magic; diff --git a/src/shared/enums/controlflow/firehub.Signal.php b/src/shared/enums/controlflow/firehub.Signal.php new file mode 100644 index 00000000..70ec6b18 --- /dev/null +++ b/src/shared/enums/controlflow/firehub.Signal.php @@ -0,0 +1,51 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.1 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Enums\ControlFlow; + +/** + * ### Control flow signals + * + * Generic control signals that can be used to influence the flow of iteration, pipelines, or other executable + * sequences across the FireHub framework. + * @since 1.0.0 + */ +enum Signal { + + /** + * ### Terminate Execution Flow + * + * Immediately stops the iteration or execution sequence and prevents any further processing of remaining items. + * @since 1.0.0 + */ + case BREAK; + + /** + * ### Continue Execution Flow + * + * Proceeds to the next iteration, marking the current item as processed and allowing normal execution flow to + * continue without interruption. + * @since 1.0.0 + */ + case CONTINUE; + + /** + * ### Skip Current Processing Step + * + * Skips processing of the current iteration while keeping the iteration flow active, allowing the next item to + * be evaluated without executing the current processing logic. + * @since 1.0.0 + */ + case SKIP; + +} \ No newline at end of file diff --git a/src/shared/enums/data/firehub.Category.php b/src/shared/enums/data/firehub.Category.php index 54e86e79..bdadab01 100644 --- a/src/shared/enums/data/firehub.Category.php +++ b/src/shared/enums/data/firehub.Category.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Data; diff --git a/src/shared/enums/data/firehub.ResourceType.php b/src/shared/enums/data/firehub.ResourceType.php index cb7492bf..40e2d225 100644 --- a/src/shared/enums/data/firehub.ResourceType.php +++ b/src/shared/enums/data/firehub.ResourceType.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Data; diff --git a/src/shared/enums/data/firehub.Type.php b/src/shared/enums/data/firehub.Type.php index 8d5fbd35..ea83deb4 100644 --- a/src/shared/enums/data/firehub.Type.php +++ b/src/shared/enums/data/firehub.Type.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Data; diff --git a/src/shared/enums/datetime/firehub.Zone.php b/src/shared/enums/datetime/firehub.Zone.php index 5f72399a..3a4efc82 100644 --- a/src/shared/enums/datetime/firehub.Zone.php +++ b/src/shared/enums/datetime/firehub.Zone.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\DateTime; diff --git a/src/shared/enums/datetime/format/firehub.Predefined.php b/src/shared/enums/datetime/format/firehub.Predefined.php index c5967f84..9cf8ada4 100644 --- a/src/shared/enums/datetime/format/firehub.Predefined.php +++ b/src/shared/enums/datetime/format/firehub.Predefined.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\DateTime\Format; diff --git a/src/shared/enums/filesystem/firehub.Permission.php b/src/shared/enums/filesystem/firehub.Permission.php index 2dd3c123..ae7280ee 100644 --- a/src/shared/enums/filesystem/firehub.Permission.php +++ b/src/shared/enums/filesystem/firehub.Permission.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\FileSystem; diff --git a/src/shared/enums/firehub.Comparison.php b/src/shared/enums/firehub.Comparison.php index 9b9829f4..bf8f053a 100644 --- a/src/shared/enums/firehub.Comparison.php +++ b/src/shared/enums/firehub.Comparison.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums; diff --git a/src/shared/enums/firehub.MutationOutcome.php b/src/shared/enums/firehub.MutationOutcome.php new file mode 100644 index 00000000..e30821ab --- /dev/null +++ b/src/shared/enums/firehub.MutationOutcome.php @@ -0,0 +1,46 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.1 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Enums; + +/** + * ### Mutation outcome enum + * @since 1.0.0 + */ +enum MutationOutcome { + + /** + * ### New Entry Created + * @since 1.0.0 + */ + case CREATED; + + /** + * ### Existing Entry Updated + * @since 1.0.0 + */ + case UPDATED; + + /** + * ### Entry Removed + * @since 1.0.0 + */ + case REMOVED; + + /** + * ### Entry Not Found + * @since 1.0.0 + */ + case NOT_FOUND; + +} \ No newline at end of file diff --git a/src/shared/enums/firehub.Order.php b/src/shared/enums/firehub.Order.php index f86a5210..eb578043 100644 --- a/src/shared/enums/firehub.Order.php +++ b/src/shared/enums/firehub.Order.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums; diff --git a/src/shared/enums/firehub.Side.php b/src/shared/enums/firehub.Side.php index 90899f8a..69f21baf 100644 --- a/src/shared/enums/firehub.Side.php +++ b/src/shared/enums/firehub.Side.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums; diff --git a/src/shared/enums/json/firehub.Flag.php b/src/shared/enums/json/firehub.Flag.php index ce08ec5f..f71f3d1a 100644 --- a/src/shared/enums/json/firehub.Flag.php +++ b/src/shared/enums/json/firehub.Flag.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Json; diff --git a/src/shared/enums/json/flag/firehub.Decode.php b/src/shared/enums/json/flag/firehub.Decode.php index 368d1851..d541208b 100644 --- a/src/shared/enums/json/flag/firehub.Decode.php +++ b/src/shared/enums/json/flag/firehub.Decode.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Json\Flag; diff --git a/src/shared/enums/json/flag/firehub.Encode.php b/src/shared/enums/json/flag/firehub.Encode.php index 7c4906ee..8da9af21 100644 --- a/src/shared/enums/json/flag/firehub.Encode.php +++ b/src/shared/enums/json/flag/firehub.Encode.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Json\Flag; diff --git a/src/shared/enums/json/flag/firehub.Error.php b/src/shared/enums/json/flag/firehub.Error.php index 388dbbc7..5410fa0f 100644 --- a/src/shared/enums/json/flag/firehub.Error.php +++ b/src/shared/enums/json/flag/firehub.Error.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Json\Flag; diff --git a/src/shared/enums/json/flag/firehub.Validate.php b/src/shared/enums/json/flag/firehub.Validate.php index a9cf5e1e..56a674b2 100644 --- a/src/shared/enums/json/flag/firehub.Validate.php +++ b/src/shared/enums/json/flag/firehub.Validate.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Json\Flag; diff --git a/src/shared/enums/number/firehub.LogBase.php b/src/shared/enums/number/firehub.LogBase.php index 2f019fa4..6e39b1f6 100644 --- a/src/shared/enums/number/firehub.LogBase.php +++ b/src/shared/enums/number/firehub.LogBase.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Number; diff --git a/src/shared/enums/number/firehub.Round.php b/src/shared/enums/number/firehub.Round.php index 3e2cebe8..db641516 100644 --- a/src/shared/enums/number/firehub.Round.php +++ b/src/shared/enums/number/firehub.Round.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\Number; diff --git a/src/shared/enums/string/count/firehub.CharacterMode.php b/src/shared/enums/string/count/firehub.CharacterMode.php index 8acfff47..16ede02f 100644 --- a/src/shared/enums/string/count/firehub.CharacterMode.php +++ b/src/shared/enums/string/count/firehub.CharacterMode.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\String\Count; diff --git a/src/shared/enums/string/count/firehub.WordFormat.php b/src/shared/enums/string/count/firehub.WordFormat.php index 237e96d9..1dfc7bd2 100644 --- a/src/shared/enums/string/count/firehub.WordFormat.php +++ b/src/shared/enums/string/count/firehub.WordFormat.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\String\Count; diff --git a/src/shared/enums/string/firehub.CaseFolding.php b/src/shared/enums/string/firehub.CaseFolding.php index a82f6808..6d74dc51 100644 --- a/src/shared/enums/string/firehub.CaseFolding.php +++ b/src/shared/enums/string/firehub.CaseFolding.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\String; diff --git a/src/shared/enums/string/firehub.Compare.php b/src/shared/enums/string/firehub.Compare.php index b8a82fce..a20703ab 100644 --- a/src/shared/enums/string/firehub.Compare.php +++ b/src/shared/enums/string/firehub.Compare.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\String; diff --git a/src/shared/enums/string/firehub.Encoding.php b/src/shared/enums/string/firehub.Encoding.php index 8528ab42..527dab59 100644 --- a/src/shared/enums/string/firehub.Encoding.php +++ b/src/shared/enums/string/firehub.Encoding.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\String; diff --git a/src/shared/enums/string/firehub.Sort.php b/src/shared/enums/string/firehub.Sort.php index 266b675e..1d9ad9b1 100644 --- a/src/shared/enums/string/firehub.Sort.php +++ b/src/shared/enums/string/firehub.Sort.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\String; diff --git a/src/shared/enums/systemruntime/firehub.IniAccessLevel.php b/src/shared/enums/systemruntime/firehub.IniAccessLevel.php index 2a297513..9fa76920 100644 --- a/src/shared/enums/systemruntime/firehub.IniAccessLevel.php +++ b/src/shared/enums/systemruntime/firehub.IniAccessLevel.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\SystemRuntime; diff --git a/src/shared/enums/systemruntime/firehub.PhpExtension.php b/src/shared/enums/systemruntime/firehub.PhpExtension.php index 0edff313..e9403946 100644 --- a/src/shared/enums/systemruntime/firehub.PhpExtension.php +++ b/src/shared/enums/systemruntime/firehub.PhpExtension.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared\Enums\SystemRuntime; diff --git a/src/shared/firehub.ValueObject.php b/src/shared/firehub.ValueObject.php index fdf9918a..542bc9de 100644 --- a/src/shared/firehub.ValueObject.php +++ b/src/shared/firehub.ValueObject.php @@ -9,13 +9,11 @@ * * @php-version 8.2 * @package Core\Shared - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Shared; -use FireHub\Core\Throwable\Error\LowLevel\InvalidValueObjectError; +use FireHub\Core\Throwable\Error\ValueObject\InvalidValueObjectError; /** * ### Base Value Object @@ -64,7 +62,7 @@ public function equals (self $other):bool { * Exception message. *

* - * @throws \FireHub\Core\Throwable\Error\LowLevel\InvalidValueObjectError If the condition is not met. + * @throws \FireHub\Core\Throwable\Error\ValueObject\InvalidValueObjectError If the condition is not met. * * @return void */ diff --git a/src/shared/type/Maybe.php b/src/shared/type/Maybe.php new file mode 100644 index 00000000..f6db7ab0 --- /dev/null +++ b/src/shared/type/Maybe.php @@ -0,0 +1,158 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Shared + */ + +namespace FireHub\Core\Shared\Type; + +use FireHub\Core\Throwable\Exception\Shared\Type\NoValueException; + +/** + * ### Optional Value Container (Maybe Type) + * + * Represents a computation result that may or may not contain a value.
+ * This abstraction explicitly encodes the presence or absence of a value, removing ambiguity between "null as + * value" and "null as state". + * + * The Maybe type is used as a safe alternative to nullable returns in Storage, Data Structure, and Application + * layers where value existence must be explicitly expressed. + * @since 1.0.0 + * + * @template TValue + */ +final readonly class Maybe { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param bool $hasValue

+ * Indicates whether a value is present. + *

+ * @param null|TValue $value [optional]

+ * Optional stored value (can be null if explicitly set via `some()`). + *

+ * + * @return void + */ + private function __construct( + private bool $hasValue, + private mixed $value = null + ) {} + + /** + * ### Create an Empty Maybe Instance + * + * Creates a Maybe instance representing the absence of a value. + * This state explicitly indicates that no value is present and is distinct from a null value. + * @since 1.0.0 + * + * @return self Empty Maybe instance. + */ + public static function none ():self { + + return new self(false); + + } + + /** + * ### Create a Maybe Instance With a Value + * + * Wraps a value into a Maybe container, explicitly marking it as present.
+ * The value may be null, but will still be considered a valid present state. + * @since 1.0.0 + * + * @template TSomeValue + * + * @param TSomeValue $value

+ * The value to wrap. + *

+ * + * @return self Maybe instance containing a value. + */ + public static function some (mixed $value):self { + + return new self(true, $value); + + } + + /** + * ### Check Value Presence + * + * Determines whether this Maybe instance contains a value.
+ * Returns true even if the stored value is null, as presence is independent of value content. + * @since 1.0.0 + * + * @return bool True if a value is present, false otherwise. + */ + public function has ():bool { + + return $this->hasValue; + + } + + /** + * ### Check Value Absence + * + * Determines whether this Maybe instance does not contain a value.
+ * This is the inverse of `has()`. + * @since 1.0.0 + * + * @return bool True if no value is present, false otherwise. + */ + public function isEmpty ():bool { + + return !$this->hasValue; + + } + + /** + * ### Retrieve Wrapped Value + * + * Returns the stored value if present.
+ * Throws an exception if no value exists in this Maybe instance. + * @since 1.0.0 + * + * @throws \FireHub\Core\Throwable\Exception\Shared\Type\NoValueException If no value is present. + * + * @return TValue The wrapped value. + */ + public function get ():mixed { + + if (!$this->hasValue) throw new NoValueException; + + /** @var TValue */ + return $this->value; + + } + + /** + * ### Unwrap Value or Default + * + * Returns the wrapped value if present, otherwise returns the provided default value.
+ * This method provides a safe fallback mechanism for empty Maybe instances. + * @since 1.0.0 + * + * @template TDefault + * + * @param TDefault $default

+ * Default value returned if Maybe is empty. + *

+ * + * @return TValue|TDefault The stored value or the default. + */ + public function unwrap (mixed $default):mixed { + + return $this->hasValue ? $this->value : $default; // @phpstan-ignore return.type + + } + +} \ No newline at end of file diff --git a/src/support/autoload/classmap.php b/src/support/autoload/classmap.php index 2c74d308..3344c1a1 100644 --- a/src/support/autoload/classmap.php +++ b/src/support/autoload/classmap.php @@ -12,8 +12,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Autoload; @@ -31,9 +29,21 @@ return [ \FireHub\Core\Domain\Autoload\Handle::class => __DIR__.'/../../domain/autoload/firehub.Handle.php', \FireHub\Core\FireHub::class => __DIR__.'/../../firehub.FireHub.php', + \FireHub\Core\Shared\Contracts\ArrayConvertable::class => __DIR__.'/../../shared/contracts/firehub.ArrayConvertable.php', + \FireHub\Core\Shared\Contracts\Arrayable::class => __DIR__.'/../../shared/contracts/firehub.Arrayable.php', + \FireHub\Core\Shared\Contracts\Countable::class => __DIR__.'/../../shared/contracts/firehub.Countable.php', + \FireHub\Core\Shared\Contracts\DataTransferObject::class => __DIR__.'/../../shared/contracts/firehub.DataTransferObject.php', + \FireHub\Core\Shared\Contracts\Iterator::class => __DIR__.'/../../shared/contracts/firehub.Iterator.php', + \FireHub\Core\Shared\Contracts\IteratorAggregate::class => __DIR__.'/../../shared/contracts/firehub.IteratorAggregate.php', + \FireHub\Core\Shared\Contracts\JsonSerializable::class => __DIR__.'/../../shared/contracts/firehub.JsonSerializable.php', + \FireHub\Core\Shared\Contracts\JsonSerializableConvertable::class => __DIR__.'/../../shared/contracts/firehub.JsonSerializableConvertable.php', + \FireHub\Core\Shared\Contracts\Magic\Serializable::class => __DIR__.'/../../shared/contracts/magic/firehub.Serializable.php', + \FireHub\Core\Shared\Contracts\Magic\SerializableConvertable::class => __DIR__.'/../../shared/contracts/magic/firehub.SerializableConvertable.php', \FireHub\Core\Shared\Contracts\Magic\Stringable::class => __DIR__.'/../../shared/contracts/magic/firehub.Stringable.php', \FireHub\Core\Shared\Contracts\Throwable::class => __DIR__.'/../../shared/contracts/firehub.Throwable.php', + \FireHub\Core\Shared\Contracts\Traversable::class => __DIR__.'/../../shared/contracts/firehub.Traversable.php', \FireHub\Core\Shared\Enums\Comparison::class => __DIR__.'/../../shared/enums/firehub.Comparison.php', + \FireHub\Core\Shared\Enums\ControlFlow\Signal::class => __DIR__.'/../../shared/enums/controlflow/firehub.Signal.php', \FireHub\Core\Shared\Enums\Data\Category::class => __DIR__.'/../../shared/enums/data/firehub.Category.php', \FireHub\Core\Shared\Enums\Data\ResourceType::class => __DIR__.'/../../shared/enums/data/firehub.ResourceType.php', \FireHub\Core\Shared\Enums\Data\Type::class => __DIR__.'/../../shared/enums/data/firehub.Type.php', @@ -45,6 +55,7 @@ \FireHub\Core\Shared\Enums\Json\Flag\Encode::class => __DIR__.'/../../shared/enums/json/flag/firehub.Encode.php', \FireHub\Core\Shared\Enums\Json\Flag\Error::class => __DIR__.'/../../shared/enums/json/flag/firehub.Error.php', \FireHub\Core\Shared\Enums\Json\Flag\Validate::class => __DIR__.'/../../shared/enums/json/flag/firehub.Validate.php', + \FireHub\Core\Shared\Enums\MutationOutcome::class => __DIR__.'/../../shared/enums/firehub.MutationOutcome.php', \FireHub\Core\Shared\Enums\Number\LogBase::class => __DIR__.'/../../shared/enums/number/firehub.LogBase.php', \FireHub\Core\Shared\Enums\Number\Round::class => __DIR__.'/../../shared/enums/number/firehub.Round.php', \FireHub\Core\Shared\Enums\Order::class => __DIR__.'/../../shared/enums/firehub.Order.php', @@ -57,6 +68,7 @@ \FireHub\Core\Shared\Enums\String\Sort::class => __DIR__.'/../../shared/enums/string/firehub.Sort.php', \FireHub\Core\Shared\Enums\SystemRuntime\IniAccessLevel::class => __DIR__.'/../../shared/enums/systemruntime/firehub.IniAccessLevel.php', \FireHub\Core\Shared\Enums\SystemRuntime\PhpExtension::class => __DIR__.'/../../shared/enums/systemruntime/firehub.PhpExtension.php', + \FireHub\Core\Shared\Type\Maybe::class => __DIR__.'/../../shared/type/Maybe.php', \FireHub\Core\Shared\ValueObject::class => __DIR__.'/../../shared/firehub.ValueObject.php', \FireHub\Core\Support\Autoload::class => __DIR__.'/../../support/firehub.Autoload.php', \FireHub\Core\Support\Autoload\Loader::class => __DIR__.'/../../support/autoload/firehub.Loader.php', @@ -68,6 +80,64 @@ \FireHub\Core\Support\Bootstrap\Bootloader\RegisterConstants::class => __DIR__.'/../../support/bootstrap/bootloader/firehub.RegisterConstants.php', \FireHub\Core\Support\Bootstrap\Bootloader\RegisterHelpers::class => __DIR__.'/../../support/bootstrap/bootloader/firehub.RegisterHelpers.php', \FireHub\Core\Support\Bootstrap\FireHubConfigurator::class => __DIR__.'/../../support/bootstrap/firehub.FireHubConfigurator.php', + \FireHub\Core\Support\Contracts\DataStructure::class => __DIR__.'/../../support/contracts/firehub.DataStructure.php', + \FireHub\Core\Support\DataStructure\Abstraction\Collection::class => __DIR__.'/../../support/datastructure/abstraction/firehub.Collection.php', + \FireHub\Core\Support\DataStructure\Capability\Copyable::class => __DIR__.'/../../support/datastructure/capability/firehub.Copyable.php', + \FireHub\Core\Support\DataStructure\Capability\Countable::class => __DIR__.'/../../support/datastructure/capability/firehub.Countable.php', + \FireHub\Core\Support\DataStructure\Capability\Enumerable::class => __DIR__.'/../../support/datastructure/capability/firehub.Enumerable.php', + \FireHub\Core\Support\DataStructure\Capability\Forkable::class => __DIR__.'/../../support/datastructure/capability/firehub.Forkable.php', + \FireHub\Core\Support\DataStructure\Capability\Freezable::class => __DIR__.'/../../support/datastructure/capability/firehub.Freezable.php', + \FireHub\Core\Support\DataStructure\Capability\Rebuildable::class => __DIR__.'/../../support/datastructure/capability/firehub.Rebuildable.php', + \FireHub\Core\Support\DataStructure\Capability\Rehydratable::class => __DIR__.'/../../support/datastructure/capability/firehub.Rehydratable.php', + \FireHub\Core\Support\DataStructure\Capability\Snapshotable::class => __DIR__.'/../../support/datastructure/capability/firehub.Snapshotable.php', + \FireHub\Core\Support\DataStructure\DTO\DehydratedState::class => __DIR__.'/../../support/datastructure/dto/firehub.DehydratedState.php', + \FireHub\Core\Support\DataStructure\DTO\StateHeader::class => __DIR__.'/../../support/datastructure/dto/firehub.StateHeader.php', + \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::class => __DIR__.'/../../support/datastructure/runtime/firehub.HasCopyOnWriteState.php', + \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::class => __DIR__.'/../../support/datastructure/runtime/firehub.HasFreezeState.php', + \FireHub\Core\Support\DataStructure\Runtime\StructureState::class => __DIR__.'/../../support/datastructure/runtime/firehub.StructureState.php', + \FireHub\Core\Support\DataStructure\Storage::class => __DIR__.'/../../support/datastructure/interface.Storage.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\BackInsertion::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.BackInsertion.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\BackMutation::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.BackMutation.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\BackRemoval::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.BackRemoval.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\Cloneable::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.Cloneable.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.Convertible.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\CyclicTraversal::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.CyclicTraversal.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\DequeMutation::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.DequeMutation.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\FrontInsertion::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.FrontInsertion.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\FrontMutation::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.FrontMutation.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\FrontRemoval::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.FrontRemoval.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\IndexAccess::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.IndexAccess.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\IndexMutation::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.IndexMutation.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\KeyAccess::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.KeyAccess.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\KeyMutation::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.KeyMutation.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\LinearBoundaryAccess::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.LinearBoundaryAccess.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\NodeAccess::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.NodeAccess.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\NodeBidirectionalInsert::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.NodeBidirectionalInsert.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\NodeInsertAfter::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.NodeInsertAfter.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\NodeInsertBefore::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.NodeInsertBefore.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\NodeMutation::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.NodeMutation.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\NodeRemoval::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.NodeRemoval.php', + \FireHub\Core\Support\DataStructure\Storage\Capability\StorageMetricsAware::class => __DIR__.'/../../support/datastructure/storage/capability/firehub.StorageMetricsAware.php', + \FireHub\Core\Support\DataStructure\Storage\Engine\ArrHashEngine::class => __DIR__.'/../../support/datastructure/storage/engine/firehub.ArrHashEngine.php', + \FireHub\Core\Support\DataStructure\Storage\GeneratorStorage::class => __DIR__.'/../../support/datastructure/storage/firehub.GeneratorStorage.php', + \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle::class => __DIR__.'/../../support/datastructure/storage/handle/firehub.NodeHandle.php', + \FireHub\Core\Support\DataStructure\Storage\HashEngine::class => __DIR__.'/../../support/datastructure/storage/firehub.HashEngine.php', + \FireHub\Core\Support\DataStructure\Storage\HashStorage::class => __DIR__.'/../../support/datastructure/storage/firehub.HashStorage.php', + \FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer::class => __DIR__.'/../../support/datastructure/storage/initialization/firehub.GeneratorStorageInitializer.php', + \FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer::class => __DIR__.'/../../support/datastructure/storage/initialization/firehub.ListStorageInitializer.php', + \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\GeneratorCallbackInitializer::class => __DIR__.'/../../support/datastructure/storage/initialization/strategy/firehub.GeneratorCallbackInitializer.php', + \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListCallbackInitializer::class => __DIR__.'/../../support/datastructure/storage/initialization/strategy/firehub.ListCallbackInitializer.php', + \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListFillInitializer::class => __DIR__.'/../../support/datastructure/storage/initialization/strategy/firehub.ListFillInitializer.php', + \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListRangeInitializer::class => __DIR__.'/../../support/datastructure/storage/initialization/strategy/firehub.ListRangeInitializer.php', + \FireHub\Core\Support\DataStructure\Storage\ListStorage::class => __DIR__.'/../../support/datastructure/storage/firehub.ListStorage.php', + \FireHub\Core\Support\DataStructure\Storage\Node::class => __DIR__.'/../../support/datastructure/storage/firehub.Node.php', + \FireHub\Core\Support\DataStructure\Structure\Map::class => __DIR__.'/../../support/datastructure/structure/firehub.Map.php', + \FireHub\Core\Support\DataStructure\Structure\Snapshot\MapSnapshot::class => __DIR__.'/../../support/datastructure/structure/snapshot/firehub.MapSnapshot.php', + \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot::class => __DIR__.'/../../support/datastructure/structure/snapshot/firehub.Snapshot.php', + \FireHub\Core\Support\DataStructure\Structure\Snapshot\VectorSnapshot::class => __DIR__.'/../../support/datastructure/structure/snapshot/firehub.VectorSnapshot.php', + \FireHub\Core\Support\DataStructure\Structure\Vector::class => __DIR__.'/../../support/datastructure/structure/firehub.Vector.php', + \FireHub\Core\Support\DataStructure\Type\Associative::class => __DIR__.'/../../support/datastructure/type/firehub.Associative.php', + \FireHub\Core\Support\DataStructure\Type\Linear::class => __DIR__.'/../../support/datastructure/type/firehub.Linear.php', \FireHub\Core\Support\LowLevel::class => __DIR__.'/../../support/firehub.LowLevel.php', \FireHub\Core\Support\LowLevel\Arr::class => __DIR__.'/../../support/lowlevel/firehub.Arr.php', \FireHub\Core\Support\LowLevel\CharMB::class => __DIR__.'/../../support/lowlevel/firehub.CharMB.php', @@ -152,7 +222,6 @@ \FireHub\Core\Throwable\Error\LowLevel\FileSystem\SetOwnerError::class => __DIR__.'/../../throwable/error/lowlevel/filesystem/firehub.SetOwnerError.php', \FireHub\Core\Throwable\Error\LowLevel\FileSystem\SetPermissionsError::class => __DIR__.'/../../throwable/error/lowlevel/filesystem/firehub.SetPermissionsError.php', \FireHub\Core\Throwable\Error\LowLevel\Func\RegisterTickFailedError::class => __DIR__.'/../../throwable/error/lowlevel/func/firehub.RegisterTickFailedError.php', - \FireHub\Core\Throwable\Error\LowLevel\InvalidValueObjectError::class => __DIR__.'/../../throwable/error/valueobject/firehub.InvalidValueObjectError.php', \FireHub\Core\Throwable\Error\LowLevel\Json\DecodeError::class => __DIR__.'/../../throwable/error/lowlevel/json/firehub.DecodeError.php', \FireHub\Core\Throwable\Error\LowLevel\Json\EncodeError::class => __DIR__.'/../../throwable/error/lowlevel/json/firehub.EncodeError.php', \FireHub\Core\Throwable\Error\LowLevel\Number\ArithmeticError::class => __DIR__.'/../../throwable/error/lowlevel/number/firehub.ArithmeticError.php', @@ -175,14 +244,29 @@ \FireHub\Core\Throwable\Error\LowLevel\SystemRuntime\InvalidConfigurationQuantityError::class => __DIR__.'/../../throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationQuantityError.php', \FireHub\Core\Throwable\Error\LowLevel\SystemRuntime\InvalidExtensionError::class => __DIR__.'/../../throwable/error/lowlevel/systemruntime/firehub.InvalidExtensionError.php', \FireHub\Core\Throwable\Error\LowLevel\SystemRuntime\SleepTimeInvalidError::class => __DIR__.'/../../throwable/error/lowlevel/systemruntime/firehub.SleepTimeInvalidError.php', + \FireHub\Core\Throwable\Error\ValueObject\InvalidValueObjectError::class => __DIR__.'/../../throwable/error/valueobject/firehub.InvalidValueObjectError.php', \FireHub\Core\Throwable\Exception::class => __DIR__.'/../../throwable/firehub.Exception.php', \FireHub\Core\Throwable\ExceptionBuilder::class => __DIR__.'/../../throwable/firehub.ExceptionBuilder.php', - \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException::class => __DIR__.'/../../throwable/exception/bootstrap/firehub.FailedToLoadBootloaderException.php', - \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException::class => __DIR__.'/../../throwable/exception/bootstrap/firehub.NotBootloaderException.php', \FireHub\Core\Throwable\Exception\Domain\Autoload\ImplementationException::class => __DIR__.'/../../throwable/exception/domain/autoload/firehub.ImplementationException.php', \FireHub\Core\Throwable\Exception\Domain\Autoload\InvalidFolderException::class => __DIR__.'/../../throwable/exception/domain/autoload/firehub.InvalidFolderException.php', \FireHub\Core\Throwable\Exception\Domain\Autoload\InvalidHandleException::class => __DIR__.'/../../throwable/exception/domain/autoload/firehub.InvalidHandleException.php', \FireHub\Core\Throwable\Exception\Domain\Autoload\InvalidNamespaceException::class => __DIR__.'/../../throwable/exception/domain/autoload/firehub.InvalidNamespaceException.php', + \FireHub\Core\Throwable\Exception\Shared\Type\NoValueException::class => __DIR__.'/../../throwable/exception/shared/type/firehub.NoValueException.php', + \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException::class => __DIR__.'/../../throwable/exception/support/bootstrap/firehub.FailedToLoadBootloaderException.php', + \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException::class => __DIR__.'/../../throwable/exception/support/bootstrap/firehub.NotBootloaderException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\EmptyDataStructureException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.EmptyDataStructureException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.FrozenDataStructureException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidBufferException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidBufferException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidCowStateException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidDataStructureException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidDataStructureException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidEngineException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidEngineException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidKeyException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidStorageException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidStorageException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidValueException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.InvalidValueException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\NodeOwnershipException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.NodeOwnershipException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\OutOfBoundsException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.OutOfBoundsException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\SizeException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.SizeException.php', + \FireHub\Core\Throwable\Exception\Support\DataStructure\WrongReturnTypeException::class => __DIR__.'/../../throwable/exception/support/datastructure/firehub.WrongReturnTypeException.php', \FireHub\Core\Throwable\Throwable::class => __DIR__.'/../../throwable/firehub.Throwable.php', \FireHub\Core\Throwable\ValueObject\Code::class => __DIR__.'/../../throwable/valueobject/firehub.Code.php', ]; \ No newline at end of file diff --git a/src/support/autoload/firehub.Loader.php b/src/support/autoload/firehub.Loader.php index d280a8c1..c7acaef1 100644 --- a/src/support/autoload/firehub.Loader.php +++ b/src/support/autoload/firehub.Loader.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Autoload; diff --git a/src/support/autoload/loader/firehub.Classmap.php b/src/support/autoload/loader/firehub.Classmap.php index e89dfe0b..8b282ee2 100644 --- a/src/support/autoload/loader/firehub.Classmap.php +++ b/src/support/autoload/loader/firehub.Classmap.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Autoload\Loader; diff --git a/src/support/autoload/loader/firehub.CompiledClassmap.php b/src/support/autoload/loader/firehub.CompiledClassmap.php index 3dd11127..85c60654 100644 --- a/src/support/autoload/loader/firehub.CompiledClassmap.php +++ b/src/support/autoload/loader/firehub.CompiledClassmap.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Autoload\Loader; @@ -50,6 +48,46 @@ public function __invoke (string $class):void { require __DIR__.'/../../../firehub.FireHub.php'; return; + case \FireHub\Core\Shared\Contracts\ArrayConvertable::class: + require __DIR__.'/../../../shared/contracts/firehub.ArrayConvertable.php'; + return; + + case \FireHub\Core\Shared\Contracts\Arrayable::class: + require __DIR__.'/../../../shared/contracts/firehub.Arrayable.php'; + return; + + case \FireHub\Core\Shared\Contracts\Countable::class: + require __DIR__.'/../../../shared/contracts/firehub.Countable.php'; + return; + + case \FireHub\Core\Shared\Contracts\DataTransferObject::class: + require __DIR__.'/../../../shared/contracts/firehub.DataTransferObject.php'; + return; + + case \FireHub\Core\Shared\Contracts\Iterator::class: + require __DIR__.'/../../../shared/contracts/firehub.Iterator.php'; + return; + + case \FireHub\Core\Shared\Contracts\IteratorAggregate::class: + require __DIR__.'/../../../shared/contracts/firehub.IteratorAggregate.php'; + return; + + case \FireHub\Core\Shared\Contracts\JsonSerializable::class: + require __DIR__.'/../../../shared/contracts/firehub.JsonSerializable.php'; + return; + + case \FireHub\Core\Shared\Contracts\JsonSerializableConvertable::class: + require __DIR__.'/../../../shared/contracts/firehub.JsonSerializableConvertable.php'; + return; + + case \FireHub\Core\Shared\Contracts\Magic\Serializable::class: + require __DIR__.'/../../../shared/contracts/magic/firehub.Serializable.php'; + return; + + case \FireHub\Core\Shared\Contracts\Magic\SerializableConvertable::class: + require __DIR__.'/../../../shared/contracts/magic/firehub.SerializableConvertable.php'; + return; + case \FireHub\Core\Shared\Contracts\Magic\Stringable::class: require __DIR__.'/../../../shared/contracts/magic/firehub.Stringable.php'; return; @@ -58,10 +96,18 @@ public function __invoke (string $class):void { require __DIR__.'/../../../shared/contracts/firehub.Throwable.php'; return; + case \FireHub\Core\Shared\Contracts\Traversable::class: + require __DIR__.'/../../../shared/contracts/firehub.Traversable.php'; + return; + case \FireHub\Core\Shared\Enums\Comparison::class: require __DIR__.'/../../../shared/enums/firehub.Comparison.php'; return; + case \FireHub\Core\Shared\Enums\ControlFlow\Signal::class: + require __DIR__.'/../../../shared/enums/controlflow/firehub.Signal.php'; + return; + case \FireHub\Core\Shared\Enums\Data\Category::class: require __DIR__.'/../../../shared/enums/data/firehub.Category.php'; return; @@ -106,6 +152,10 @@ public function __invoke (string $class):void { require __DIR__.'/../../../shared/enums/json/flag/firehub.Validate.php'; return; + case \FireHub\Core\Shared\Enums\MutationOutcome::class: + require __DIR__.'/../../../shared/enums/firehub.MutationOutcome.php'; + return; + case \FireHub\Core\Shared\Enums\Number\LogBase::class: require __DIR__.'/../../../shared/enums/number/firehub.LogBase.php'; return; @@ -154,6 +204,10 @@ public function __invoke (string $class):void { require __DIR__.'/../../../shared/enums/systemruntime/firehub.PhpExtension.php'; return; + case \FireHub\Core\Shared\Type\Maybe::class: + require __DIR__.'/../../../shared/type/Maybe.php'; + return; + case \FireHub\Core\Shared\ValueObject::class: require __DIR__.'/../../../shared/firehub.ValueObject.php'; return; @@ -198,6 +252,238 @@ public function __invoke (string $class):void { require __DIR__.'/../../../support/bootstrap/firehub.FireHubConfigurator.php'; return; + case \FireHub\Core\Support\Contracts\DataStructure::class: + require __DIR__.'/../../../support/contracts/firehub.DataStructure.php'; + return; + + case \FireHub\Core\Support\DataStructure\Abstraction\Collection::class: + require __DIR__.'/../../../support/datastructure/abstraction/firehub.Collection.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Copyable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Copyable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Countable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Countable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Enumerable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Enumerable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Forkable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Forkable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Freezable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Freezable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Rebuildable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Rebuildable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Rehydratable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Rehydratable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Capability\Snapshotable::class: + require __DIR__.'/../../../support/datastructure/capability/firehub.Snapshotable.php'; + return; + + case \FireHub\Core\Support\DataStructure\DTO\DehydratedState::class: + require __DIR__.'/../../../support/datastructure/dto/firehub.DehydratedState.php'; + return; + + case \FireHub\Core\Support\DataStructure\DTO\StateHeader::class: + require __DIR__.'/../../../support/datastructure/dto/firehub.StateHeader.php'; + return; + + case \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::class: + require __DIR__.'/../../../support/datastructure/runtime/firehub.HasCopyOnWriteState.php'; + return; + + case \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::class: + require __DIR__.'/../../../support/datastructure/runtime/firehub.HasFreezeState.php'; + return; + + case \FireHub\Core\Support\DataStructure\Runtime\StructureState::class: + require __DIR__.'/../../../support/datastructure/runtime/firehub.StructureState.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage::class: + require __DIR__.'/../../../support/datastructure/interface.Storage.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\BackInsertion::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.BackInsertion.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\BackMutation::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.BackMutation.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\BackRemoval::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.BackRemoval.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\Cloneable::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.Cloneable.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.Convertible.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\CyclicTraversal::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.CyclicTraversal.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\DequeMutation::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.DequeMutation.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\FrontInsertion::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.FrontInsertion.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\FrontMutation::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.FrontMutation.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\FrontRemoval::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.FrontRemoval.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\IndexAccess::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.IndexAccess.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\IndexMutation::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.IndexMutation.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\KeyAccess::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.KeyAccess.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\KeyMutation::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.KeyMutation.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\LinearBoundaryAccess::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.LinearBoundaryAccess.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\NodeAccess::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.NodeAccess.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\NodeBidirectionalInsert::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.NodeBidirectionalInsert.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\NodeInsertAfter::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.NodeInsertAfter.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\NodeInsertBefore::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.NodeInsertBefore.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\NodeMutation::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.NodeMutation.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\NodeRemoval::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.NodeRemoval.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Capability\StorageMetricsAware::class: + require __DIR__.'/../../../support/datastructure/storage/capability/firehub.StorageMetricsAware.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Engine\ArrHashEngine::class: + require __DIR__.'/../../../support/datastructure/storage/engine/firehub.ArrHashEngine.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\GeneratorStorage::class: + require __DIR__.'/../../../support/datastructure/storage/firehub.GeneratorStorage.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle::class: + require __DIR__.'/../../../support/datastructure/storage/handle/firehub.NodeHandle.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\HashEngine::class: + require __DIR__.'/../../../support/datastructure/storage/firehub.HashEngine.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\HashStorage::class: + require __DIR__.'/../../../support/datastructure/storage/firehub.HashStorage.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer::class: + require __DIR__.'/../../../support/datastructure/storage/initialization/firehub.GeneratorStorageInitializer.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer::class: + require __DIR__.'/../../../support/datastructure/storage/initialization/firehub.ListStorageInitializer.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\GeneratorCallbackInitializer::class: + require __DIR__.'/../../../support/datastructure/storage/initialization/strategy/firehub.GeneratorCallbackInitializer.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListCallbackInitializer::class: + require __DIR__.'/../../../support/datastructure/storage/initialization/strategy/firehub.ListCallbackInitializer.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListFillInitializer::class: + require __DIR__.'/../../../support/datastructure/storage/initialization/strategy/firehub.ListFillInitializer.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListRangeInitializer::class: + require __DIR__.'/../../../support/datastructure/storage/initialization/strategy/firehub.ListRangeInitializer.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\ListStorage::class: + require __DIR__.'/../../../support/datastructure/storage/firehub.ListStorage.php'; + return; + + case \FireHub\Core\Support\DataStructure\Storage\Node::class: + require __DIR__.'/../../../support/datastructure/storage/firehub.Node.php'; + return; + + case \FireHub\Core\Support\DataStructure\Structure\Map::class: + require __DIR__.'/../../../support/datastructure/structure/firehub.Map.php'; + return; + + case \FireHub\Core\Support\DataStructure\Structure\Snapshot\MapSnapshot::class: + require __DIR__.'/../../../support/datastructure/structure/snapshot/firehub.MapSnapshot.php'; + return; + + case \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot::class: + require __DIR__.'/../../../support/datastructure/structure/snapshot/firehub.Snapshot.php'; + return; + + case \FireHub\Core\Support\DataStructure\Structure\Snapshot\VectorSnapshot::class: + require __DIR__.'/../../../support/datastructure/structure/snapshot/firehub.VectorSnapshot.php'; + return; + + case \FireHub\Core\Support\DataStructure\Structure\Vector::class: + require __DIR__.'/../../../support/datastructure/structure/firehub.Vector.php'; + return; + + case \FireHub\Core\Support\DataStructure\Type\Associative::class: + require __DIR__.'/../../../support/datastructure/type/firehub.Associative.php'; + return; + + case \FireHub\Core\Support\DataStructure\Type\Linear::class: + require __DIR__.'/../../../support/datastructure/type/firehub.Linear.php'; + return; + case \FireHub\Core\Support\LowLevel::class: require __DIR__.'/../../../support/firehub.LowLevel.php'; return; @@ -534,10 +820,6 @@ public function __invoke (string $class):void { require __DIR__.'/../../../throwable/error/lowlevel/func/firehub.RegisterTickFailedError.php'; return; - case \FireHub\Core\Throwable\Error\LowLevel\InvalidValueObjectError::class: - require __DIR__.'/../../../throwable/error/valueobject/firehub.InvalidValueObjectError.php'; - return; - case \FireHub\Core\Throwable\Error\LowLevel\Json\DecodeError::class: require __DIR__.'/../../../throwable/error/lowlevel/json/firehub.DecodeError.php'; return; @@ -626,6 +908,10 @@ public function __invoke (string $class):void { require __DIR__.'/../../../throwable/error/lowlevel/systemruntime/firehub.SleepTimeInvalidError.php'; return; + case \FireHub\Core\Throwable\Error\ValueObject\InvalidValueObjectError::class: + require __DIR__.'/../../../throwable/error/valueobject/firehub.InvalidValueObjectError.php'; + return; + case \FireHub\Core\Throwable\Exception::class: require __DIR__.'/../../../throwable/firehub.Exception.php'; return; @@ -634,14 +920,6 @@ public function __invoke (string $class):void { require __DIR__.'/../../../throwable/firehub.ExceptionBuilder.php'; return; - case \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException::class: - require __DIR__.'/../../../throwable/exception/bootstrap/firehub.FailedToLoadBootloaderException.php'; - return; - - case \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException::class: - require __DIR__.'/../../../throwable/exception/bootstrap/firehub.NotBootloaderException.php'; - return; - case \FireHub\Core\Throwable\Exception\Domain\Autoload\ImplementationException::class: require __DIR__.'/../../../throwable/exception/domain/autoload/firehub.ImplementationException.php'; return; @@ -658,6 +936,70 @@ public function __invoke (string $class):void { require __DIR__.'/../../../throwable/exception/domain/autoload/firehub.InvalidNamespaceException.php'; return; + case \FireHub\Core\Throwable\Exception\Shared\Type\NoValueException::class: + require __DIR__.'/../../../throwable/exception/shared/type/firehub.NoValueException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException::class: + require __DIR__.'/../../../throwable/exception/support/bootstrap/firehub.FailedToLoadBootloaderException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException::class: + require __DIR__.'/../../../throwable/exception/support/bootstrap/firehub.NotBootloaderException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\EmptyDataStructureException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.EmptyDataStructureException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.FrozenDataStructureException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidBufferException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidBufferException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidCowStateException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidDataStructureException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidDataStructureException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidEngineException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidEngineException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidKeyException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidStorageException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidStorageException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidValueException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.InvalidValueException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\NodeOwnershipException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.NodeOwnershipException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\OutOfBoundsException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.OutOfBoundsException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\SizeException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.SizeException.php'; + return; + + case \FireHub\Core\Throwable\Exception\Support\DataStructure\WrongReturnTypeException::class: + require __DIR__.'/../../../throwable/exception/support/datastructure/firehub.WrongReturnTypeException.php'; + return; + case \FireHub\Core\Throwable\Throwable::class: require __DIR__.'/../../../throwable/firehub.Throwable.php'; return; diff --git a/src/support/autoload/loader/firehub.Resolver.php b/src/support/autoload/loader/firehub.Resolver.php index f6a9a41d..c43e8032 100644 --- a/src/support/autoload/loader/firehub.Resolver.php +++ b/src/support/autoload/loader/firehub.Resolver.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Autoload\Loader; @@ -37,7 +35,7 @@ final class Resolver implements Loader { /** - * ### List of namespaces prefixes with its folders + * ### List of namespace prefixes with its folders * * An associative array where the key is a namespace prefix, and the value is an array of base folders for classes * in that namespace. diff --git a/src/support/bootstrap/bootloader/firehub.RegisterAutoloaders.php b/src/support/bootstrap/bootloader/firehub.RegisterAutoloaders.php index 1534c1eb..6f5a8550 100644 --- a/src/support/bootstrap/bootloader/firehub.RegisterAutoloaders.php +++ b/src/support/bootstrap/bootloader/firehub.RegisterAutoloaders.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Bootstrap\Bootloader; diff --git a/src/support/bootstrap/bootloader/firehub.RegisterConstants.php b/src/support/bootstrap/bootloader/firehub.RegisterConstants.php index 41dc6647..c2750913 100644 --- a/src/support/bootstrap/bootloader/firehub.RegisterConstants.php +++ b/src/support/bootstrap/bootloader/firehub.RegisterConstants.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Bootstrap\Bootloader; diff --git a/src/support/bootstrap/bootloader/firehub.RegisterHelpers.php b/src/support/bootstrap/bootloader/firehub.RegisterHelpers.php index 1c21e05d..22f6583c 100644 --- a/src/support/bootstrap/bootloader/firehub.RegisterHelpers.php +++ b/src/support/bootstrap/bootloader/firehub.RegisterHelpers.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Bootstrap\Bootloader; diff --git a/src/support/bootstrap/firehub.Bootloader.php b/src/support/bootstrap/firehub.Bootloader.php index 0e8395f4..def47dae 100644 --- a/src/support/bootstrap/firehub.Bootloader.php +++ b/src/support/bootstrap/firehub.Bootloader.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Bootstrap; diff --git a/src/support/bootstrap/firehub.FireHubConfigurator.php b/src/support/bootstrap/firehub.FireHubConfigurator.php index 12697ad4..3f842eac 100644 --- a/src/support/bootstrap/firehub.FireHubConfigurator.php +++ b/src/support/bootstrap/firehub.FireHubConfigurator.php @@ -9,8 +9,6 @@ * * @php-version 8.4 * @package Core - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\Bootstrap; @@ -64,9 +62,10 @@ public function withBootloaders (array $bootloaders):self { * * @uses \FireHub\Core\FireHub As return. * - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException If a bootloader fails to - * load. - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException If a bootloader is not a bootloader. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException If a bootloader + * fails to load. + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException If a bootloader is not + * a bootloader. * * @return \FireHub\Core\FireHub New Firehub Framework application. */ diff --git a/src/support/contracts/firehub.DataStructure.php b/src/support/contracts/firehub.DataStructure.php new file mode 100644 index 00000000..b0751e83 --- /dev/null +++ b/src/support/contracts/firehub.DataStructure.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\Contracts; + +/** + * ### Data structure Contract + * + * Represents the root abstraction for all data structures within the system. + * A data structure defines the semantic interpretation and usage model of data, independent of its underlying storage + * mechanism.
+ * It serves as a type identity and architectural boundary, enabling consistent classification, composition, and + * interaction across different structural paradigms.
+ * This interface does not define behavior or operations but establishes a common contract for all structures that + * organize and expose data meaningfully. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface DataStructure {} \ No newline at end of file diff --git a/src/support/datastructure/abstraction/firehub.Collection.php b/src/support/datastructure/abstraction/firehub.Collection.php new file mode 100644 index 00000000..f3657d37 --- /dev/null +++ b/src/support/datastructure/abstraction/firehub.Collection.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Abstraction; + +use FireHub\Core\Support\DataStructure\Capability\Enumerable; + +/** + * ### Collection Data Structure + * + * Represents an enumerable and structured group of elements that provides consistent storage, traversal, access, and + * optional mutation semantics. Collections serve as the foundational abstraction for linear, associative, and + * set-based data structures while maintaining a unified iteration model over their contained values. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Capability\Enumerable + */ +interface Collection extends Enumerable {} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Copyable.php b/src/support/datastructure/capability/firehub.Copyable.php new file mode 100644 index 00000000..61a1a90a --- /dev/null +++ b/src/support/datastructure/capability/firehub.Copyable.php @@ -0,0 +1,35 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +/** + * ### Copyable Data Structure + * + * Provides a full deep copy of the data structure with no shared state.
+ * Unlike fork, this operation guarantees full isolation. + * @since 1.0.0 + */ +interface Copyable { + + /** + * ### Create deep independent copy + * + * Returns a completely isolated instance with duplicated internal state. + * @since 1.0.0 + * + * @return static Deep independent copy. + */ + public function copy ():static; + +} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Countable.php b/src/support/datastructure/capability/firehub.Countable.php new file mode 100644 index 00000000..e8a1d2d0 --- /dev/null +++ b/src/support/datastructure/capability/firehub.Countable.php @@ -0,0 +1,40 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +/** + * ### Enumerable Data Structure Capability + * + * Defines a contract for data structures that maintain a measurable logical element count. This capability ensures + * that a structure can expose the number of contained elements in a consistent, domain-specific manner, independent of + * its underlying storage implementation. It applies only to materialized data structures where element cardinality + * is well-defined, enabling predictable size semantics across data structures. + * @since 1.0.0 + */ +interface Countable { + + /** + * ### Element Count Retrieval + * + * Returns the total number of logically stored elements within the data structure. This value represents the + * current cardinality of the structure in its abstract form and is independent of the underlying storage + * implementation or memory layout. It is defined only for materialized data structures where element count is + * well-defined and stable. + * @since 1.0.0 + * + * @return non-negative-int Total number of logically stored elements in the structure. + */ + public function count ():int; + +} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Enumerable.php b/src/support/datastructure/capability/firehub.Enumerable.php new file mode 100644 index 00000000..bc29182e --- /dev/null +++ b/src/support/datastructure/capability/firehub.Enumerable.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +use FireHub\Core\Shared\Contracts\IteratorAggregate; + +/** + * ### Enumerable Data Structure Capability + * + * Represents a data structure that exposes a unified iteration contract, enabling traversal of its elements in a + * sequential manner via an external or internal iterator. This capability does not define storage behavior or mutation + * rules but provides a consistent way to traverse underlying elements regardless of the structure type. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @extends \FireHub\Core\Shared\Contracts\IteratorAggregate + */ +interface Enumerable extends IteratorAggregate {} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Forkable.php b/src/support/datastructure/capability/firehub.Forkable.php new file mode 100644 index 00000000..90413ee8 --- /dev/null +++ b/src/support/datastructure/capability/firehub.Forkable.php @@ -0,0 +1,36 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +/** + * ### Forkable Data Structure + * + * Provides a lightweight branching mechanism where the structure shares underlying state until a write operation + * forces a copy-on-write detach.
+ * This enables efficient snapshot-like workflows with minimal memory overhead. + * @since 1.0.0 + */ +interface Forkable { + + /** + * ### Create a shared state fork + * + * Creates a new instance that shares underlying storage/state with the current instance until a mutation occurs. + * @since 1.0.0 + * + * @return static Shared state fork. + */ + public function fork ():static; + +} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Freezable.php b/src/support/datastructure/capability/firehub.Freezable.php new file mode 100644 index 00000000..70bf7a83 --- /dev/null +++ b/src/support/datastructure/capability/firehub.Freezable.php @@ -0,0 +1,35 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +/** + * ### Freezable Data Structure + * + * Allows a data structure to be permanently or temporarily locked from any mutation operations.
+ * Once frozen, all write operations must be rejected. + * @since 1.0.0 + */ +interface Freezable { + + /** + * ### Freeze structure (make immutable) + * + * Prevents any further modifications to the structure state. + * @since 1.0.0 + * + * @return void + */ + public function freeze ():void; + +} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Rebuildable.php b/src/support/datastructure/capability/firehub.Rebuildable.php new file mode 100644 index 00000000..8035b040 --- /dev/null +++ b/src/support/datastructure/capability/firehub.Rebuildable.php @@ -0,0 +1,67 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +/** + * ### Rebuildable Capability + * + * Defines the ability to rebuild a data structure using the same semantic structure while allowing internal + * implementation changes. + * + * Rebuilding preserves: + * - Structural meaning + * - Ordering semantics + * - Key/value relationships + * - Behavioral contracts + * + * But may change: + * - Storage backend + * - Memory layout + * - Internal optimization strategy + * - Capacity model + * + * Rebuild is considered an implementation-level lifecycle operation. + * @since 1.0.0 + * + * @template TStorage of \FireHub\Core\Support\DataStructure\Storage + */ +interface Rebuildable { + + /** + * ### Rebuild structure using a different implementation strategy + * + * Reconstructs the same logical structure using another storage backend, memory strategy, or internal + * optimization model while preserving the exact semantic behavior of the original structure. + * + * This operation MUST NOT change: + * - Structural category + * - Public semantics + * - Key/value meaning + * - Traversal behavior + * + * It MAY change: + * - Runtime performance characteristics + * - Storage representation + * - Internal indexing layout + * @since 1.0.0 + * + * @param class-string $storage

+ * Target storage implementation. + *

+ * + * @return static Rebuilt structure instance. + */ + public function rebuild (string $storage):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Rehydratable.php b/src/support/datastructure/capability/firehub.Rehydratable.php new file mode 100644 index 00000000..10abcc4d --- /dev/null +++ b/src/support/datastructure/capability/firehub.Rehydratable.php @@ -0,0 +1,73 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +use FireHub\Core\Support\DataStructure\DTO\DehydratedState; + +/** + * ### Rehydratable Capability + * + * Defines a reversible lifecycle contract for objects that can be converted into a canonical dehydrated state and + * reconstructed back into their original form. + * + * This contract guarantees that a data structure can: + * - Be safely serialized into a deterministic state representation + * - Be fully restored without loss of structural integrity + * - Participate in persistence, transport, and transformation pipelines + * + * It forms the foundation of FireHub's DS lifecycle model. + * @since 1.0.0 + * + * @template TStructure of \FireHub\Core\Support\Contracts\DataStructure + * @template TStorage of \FireHub\Core\Support\DataStructure\Storage + * @template TArray of array + */ +interface Rehydratable { + + /** + * ### Extract the canonical structural state representation + * + * Exports the logical contents and structural metadata of the data structure into a deterministic, lossless, and + * implementation-independent format. + * + * The resulting state must contain enough information to fully reconstruct the structure through the + * corresponding hydration process. + * @since 1.0.0 + * + * @return \FireHub\Core\Support\DataStructure\DTO\DehydratedState Canonical dehydrated + * structure state. + */ + public function dehydrate ():DehydratedState; + + /** + * ### Reconstruct structure from a canonical state + * + * Reconstructs a fully functional data structure instance from a canonical DehydratedState snapshot. + * Hydration is a deterministic reverse lifecycle operation that restores the original structural identity of a + * data structure without altering its semantic meaning or introducing runtime-specific side effects. + * @since 1.0.0 + * + * @template TNewStructure of TStructure + * @template TNewStorage of TStorage + * @template TNewArray of TArray + * + * @param \FireHub\Core\Support\DataStructure\DTO\DehydratedState $state

+ * Canonical state snapshot. + *

+ * + * @return static Fully reconstructed data structure. + */ + public static function hydrate (DehydratedState $state):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/capability/firehub.Snapshotable.php b/src/support/datastructure/capability/firehub.Snapshotable.php new file mode 100644 index 00000000..69d5bfaf --- /dev/null +++ b/src/support/datastructure/capability/firehub.Snapshotable.php @@ -0,0 +1,43 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Capability; + +use FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot; + +/** + * ### Snapshotable Data Structure + * + * Provides a read-only view of the current state of a data structure.
+ * Snapshot is typically optimized for zero-copy or shared-storage access. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface Snapshotable { + + /** + * ### Create an immutable snapshot of the current state + * + * Returns a read-only representation of the structure at a point in time. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot As return. + * + * @return \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot Immutable snapshot of + * current state. + */ + public function snapshot ():Snapshot; + +} \ No newline at end of file diff --git a/src/support/datastructure/dto/firehub.DehydratedState.php b/src/support/datastructure/dto/firehub.DehydratedState.php new file mode 100644 index 00000000..cdf2df96 --- /dev/null +++ b/src/support/datastructure/dto/firehub.DehydratedState.php @@ -0,0 +1,57 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\DTO; + +use FireHub\Core\Shared\Contracts\DataTransferObject; + +/** + * ### Dehydrated State + * + * Immutable canonical snapshot of a DataStructure at a specific point in time. + * + * It represents a transportable, storage-independent representation of a data + * structure, used for: + * - Hydration (reconstruction of the same structure) + * - Persistence (storage encoding) + * - Transformation (forge pipelines) + * + * The state is NOT tied to memory layout, runtime behavior, or storage engine. + * It is a pure structural representation of data and relationships. + * @since 1.0.0 + * + * @template TStructure of \FireHub\Core\Support\Contracts\DataStructure + * @template TStorage of \FireHub\Core\Support\DataStructure\Storage + * @template TArray of array + */ +final readonly class DehydratedState implements DataTransferObject { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param \FireHub\Core\Support\DataStructure\DTO\StateHeader $header

+ * Header of the state. + *

+ * @param TArray $payload

+ * Payload of the state. + *

+ * + * @return void + */ + public function __construct ( + public StateHeader $header, + public array $payload + ) {} + +} \ No newline at end of file diff --git a/src/support/datastructure/dto/firehub.StateHeader.php b/src/support/datastructure/dto/firehub.StateHeader.php new file mode 100644 index 00000000..8c7bbd0d --- /dev/null +++ b/src/support/datastructure/dto/firehub.StateHeader.php @@ -0,0 +1,53 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\DTO; + +use FireHub\Core\Shared\Contracts\DataTransferObject; + +/** + * ### State Header + * + * Immutable metadata describing a dehydrated data structure state. + * + * Contains only structural identity and compatibility information, not runtime or business logic. + * @since 1.0.0 + * + * @template TStructure of \FireHub\Core\Support\Contracts\DataStructure + * @template TStorage of \FireHub\Core\Support\DataStructure\Storage + */ +final readonly class StateHeader implements DataTransferObject { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param positive-int $version

+ * Version of the data structure hydration. + *

+ * @param class-string $structure

+ * Name of the data structure. + *

+ * @param class-string $storage

+ * Name of the storage. + *

+ * + * @return void + */ + public function __construct ( + public int $version, + public string $structure, + public string $storage + ) {} + +} \ No newline at end of file diff --git a/src/support/datastructure/interface.Storage.php b/src/support/datastructure/interface.Storage.php new file mode 100644 index 00000000..048a3871 --- /dev/null +++ b/src/support/datastructure/interface.Storage.php @@ -0,0 +1,44 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure; + +/** + * ### Storage Abstraction Layer + * + * Root contract for all storage implementations in the system.
+ * A Storage represents a persistence boundary responsible for holding, exposing, and iterating over data entries + * through a unified access model. It abstracts away the underlying memory or structural representation, ensuring that + * all implementations provide a consistent entry-based interface for consumption by Data Structures. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface Storage { + + /** + * ### Traverses Storage Elements + * + * Provides a unified, read-only traversal contract for accessing all elements within a storage implementation. + * The method exposes elements in their natural iteration order without leaking internal structure details or + * coupling the consumer to a specific storage strategy. + * Each storage implementation defines its own traversal mechanism, but all must guarantee compliance with + * the iterable contract and ensure safe, side-effect-free iteration over the current state. + * @since 1.0.0 + * + * @return iterable + */ + public function iterate ():iterable; + +} \ No newline at end of file diff --git a/src/support/datastructure/runtime/firehub.HasCopyOnWriteState.php b/src/support/datastructure/runtime/firehub.HasCopyOnWriteState.php new file mode 100644 index 00000000..2eee5033 --- /dev/null +++ b/src/support/datastructure/runtime/firehub.HasCopyOnWriteState.php @@ -0,0 +1,84 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.4 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Runtime; + +/** + * ### Copy-On-Write State Management + * + * Provides structural sharing and lazy cloning behavior for data structures. This trait enables multiple instances + * to share the same underlying storage until a mutation forces a safe deep copy (detach). + * + * It is responsible only for ownership tracking and memory sharing logic, not for mutation rules or immutability + * enforcement. + * @since 1.0.0 + */ +trait HasCopyOnWriteState { + + /** + * ### Data Structure Structural State + * @since 1.0.0 + * + * @var \FireHub\Core\Support\DataStructure\Runtime\StructureState + */ + private StructureState $state; + + /** + * ### Conditional Storage Detachment + * + * Performs a copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * This ensures mutation safety by creating an isolated storage copy before any write operation is performed. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Runtime\StructureState::isExclusive() To check if the storage is + * exclusive (not shared). + * @uses \FireHub\Core\Support\DataStructure\Runtime\StructureState::decreaseRefs() To decrease Reference Counter. + * @uses \FireHub\Core\Support\DataStructure\Capability\Copyable::copy() To create a full independent deep copy + * of the storage if needed. + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return void + */ + private function detachIfNeeded ():void { + + if ($this->state->isExclusive()) return; + + $this->storage = $this->storage->copy(); + + $this->state->decreaseRefs(); + + $this->state = new StructureState(); + + } + + /** + * ### Increase Shared Ownership Reference + * + * Increments the internal reference counter when a new data structure instance begins sharing the same storage + * (e.g., fork operation). + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Runtime\StructureState::increaseRefs() To increase Reference Counter. + * + * @return void + */ + private function increaseRef ():void { + + $this->state->increaseRefs(); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/runtime/firehub.HasFreezeState.php b/src/support/datastructure/runtime/firehub.HasFreezeState.php new file mode 100644 index 00000000..1d789d73 --- /dev/null +++ b/src/support/datastructure/runtime/firehub.HasFreezeState.php @@ -0,0 +1,71 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.4 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Runtime; + +use FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException; + +/** + * ### Mutation Freeze Control + * + * Provides the ability to lock a data structure into an immutable state. Once frozen, all mutation operations must + * be rejected. + * + * This trait is responsible only for mutation safety enforcement and does not manage memory sharing or storage + * duplication. + * @since 1.0.0 + */ +trait HasFreezeState { + + /** + * ### Frozen State Flag + * + * Indicates whether the data structure is immutable. When true, all mutation attempts must throw an exception. + * @since 1.0.0 + * + * @var bool True if structure is frozen, false otherwise. + */ + private bool $frozen = false; + + /** + * ### Check Frozen State + * + * Returns whether the data structure is currently immutable. + * @since 1.0.0 + * + * @return bool True if frozen, false otherwise. + */ + public function isFrozen ():bool { + + return $this->frozen; + + } + + /** + * ### Mutation Guard: Freeze Check + * + * Ensures that the data structure is not in a frozen state before allowing any mutation operation to proceed. + * @since 1.0.0 + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure + * is frozen. + * + * @return void + */ + private function assertNotFrozen ():void { + + if ($this->frozen) throw new FrozenDataStructureException; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/runtime/firehub.StructureState.php b/src/support/datastructure/runtime/firehub.StructureState.php new file mode 100644 index 00000000..5d83ec7f --- /dev/null +++ b/src/support/datastructure/runtime/firehub.StructureState.php @@ -0,0 +1,104 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.4 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Runtime; + +use FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException; + +/** + * ### Data Structure Structural State + * + * Represents shared runtime state between multiple instances of a data structure.
+ * This includes ownership tracking (COW), versioning metadata, and shared lifecycle control. + * @since 1.0.0 + */ +final class StructureState { + + /** + * ### Shared Ownership Counter + * + * Tracks how many data structure instances share the same underlying storage.
+ * Used to determine when a safe detaching (copy-on-write) is required. + * @since 1.0.0 + * + * @var positive-int Number of active references to shared storage. + */ + private int $refs = 1; + + /** + * ### Retrieve Reference Counter value + * @since 1.0.0 + * + * @return positive-int Reference counter value. + */ + public function getRefs ():int { + + return $this->refs; + + } + + /** + * ### Increase Reference Counter + * @since 1.0.0 + * + * @return void + */ + public function increaseRefs ():void { + + $this->refs++; + + } + + /** + * ### Decrease Reference Counter + * @since 1.0.0 + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return void + */ + public function decreaseRefs ():void { + + if ($this->refs <= 1) + throw new InvalidCowStateException('Invalid COW state: cannot drop below 1.'); + + $this->refs--; + + } + + /** + * ### Check if Reference Counter is shared + * @since 1.0.0 + * + * @return bool True if Reference Counter is shared, false otherwise. + */ + public function isShared(): bool { + + return $this->refs > 1; + + } + + /** + * ### Check if Reference Counter is exclusive + * @since 1.0.0 + * + * @return bool True if Reference Counter is exclusive, false otherwise. + */ + public function isExclusive(): bool { + + return $this->refs === 1; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.BackInsertion.php b/src/support/datastructure/storage/capability/firehub.BackInsertion.php new file mode 100644 index 00000000..d76a04a9 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.BackInsertion.php @@ -0,0 +1,39 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Back Insertion + * + * Provides the ability to insert one or more elements at the logical end of the structure in constant time, assuming + * tail access is available. + * @since 1.0.0 + * + * @template TValue + */ +interface BackInsertion { + + /** + * ### Append values to the back + * @since 1.0.0 + * + * @param TValue ...$values

+ * List of values to add to the back of the storage. + *

+ * + * @return static The modified storage structure. + */ + public function addLast (mixed ...$values):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.BackMutation.php b/src/support/datastructure/storage/capability/firehub.BackMutation.php new file mode 100644 index 00000000..0d5f9267 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.BackMutation.php @@ -0,0 +1,26 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Back Mutation Capability + * + * Combines back insertion and back removal, enabling full mutation of the logical end of the structure. + * @since 1.0.0 + * + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\BackInsertion + */ +interface BackMutation extends BackInsertion, BackRemoval {} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.BackRemoval.php b/src/support/datastructure/storage/capability/firehub.BackRemoval.php new file mode 100644 index 00000000..8b1c48e2 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.BackRemoval.php @@ -0,0 +1,36 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Back Removal + * + * Provides the ability to remove one or more elements from the logical end of the structure in constant time. + * @since 1.0.0 + */ +interface BackRemoval { + + /** + * ### Removes values from the back + * @since 1.0.0 + * + * @param int $items [optional]

+ * Number of values to remove from the back of the storage. + *

+ * + * @return static The modified storage structure. + */ + public function removeLast (int $items = 1):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.Cloneable.php b/src/support/datastructure/storage/capability/firehub.Cloneable.php new file mode 100644 index 00000000..78ffc55d --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.Cloneable.php @@ -0,0 +1,40 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Provide explicit deep copy of a storage + * + * Defines a contract for creating a full, independent copy of a storage by duplicating all underlying data. The + * resulting instance has no shared state with the original, ensuring complete isolation at the cost of O(n) time and + * memory complexity. Suitable for scenarios where data integrity and independence are required over performance + * optimizations. + * @since 1.0.0 + */ +interface Cloneable { + + /** + * ### Create a full independent deep copy of the storage + * + * Creates a completely independent clone of the storage by duplicating all internal data. The resulting instance + * shares no state with the original, ensuring full isolation between both objects. This operation has O(n) time + * and memory complexity and is suitable when data integrity and strict independence are required over performance + * optimization. + * @since 1.0.0 + * + * @return static A deep copy of the storage. + */ + public function copy ():static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.Convertible.php b/src/support/datastructure/storage/capability/firehub.Convertible.php new file mode 100644 index 00000000..75f540b8 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.Convertible.php @@ -0,0 +1,47 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Support\DataStructure\Storage; + +/** + * ### Storage Convertible Capability + * + * Defines a contract for storage implementations that can be constructed from another storage instance. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface Convertible { + + /** + * ### Create from another storage + * + * Creates a new storage instance from an existing storage. + * @since 1.0.0 + * + * @template TStorageKey of TKey + * @template TStorageValue of TValue + * @template TStorage of \FireHub\Core\Support\DataStructure\Storage + * + * @param TStorage $storage

+ * Provided storage. + *

+ * + * @return static New storage from provided storage. + */ + public static function fromStorage (Storage $storage):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.CyclicTraversal.php b/src/support/datastructure/storage/capability/firehub.CyclicTraversal.php new file mode 100644 index 00000000..dbaa981b --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.CyclicTraversal.php @@ -0,0 +1,47 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Cyclic Traversal Capability + * + * Provides the ability to traverse a data structure in a continuous infinite loop. This capability is intended for + * cyclic or circular data structures where iteration does not terminate naturally and instead restarts from the + * beginning upon reaching the end. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface CyclicTraversal { + + /** + * ### Cycle through elements infinitely + * + * Returns an infinite iterable sequence that continuously traverses the structure in a loop, restarting from the + * beginning once the end is reached. + * @since 1.0.0 + * + * @param null|int $limit

+ * Maximum number of elements to yield. If null, traversal is infinite. + *

+ * + * @return iterable Infinite cyclic traversal of elements. + * + * @warning This method does not terminate naturally and must be consumed with care + * (e.g. with limits or external stopping conditions). + */ + public function cycle (?int $limit = null):iterable; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.DequeMutation.php b/src/support/datastructure/storage/capability/firehub.DequeMutation.php new file mode 100644 index 00000000..2a0ff754 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.DequeMutation.php @@ -0,0 +1,30 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Deque End Mutation Capability + * + * Defines the ability of a storage structure to perform double-ended mutations on a linear sequence. This includes + * adding elements to both ends (append and prepend) as well as removing elements from both ends (pop and shift). + * It is intended for data structures that maintain ordered elements with efficient front and back operations, such as + * deque, linked lists, and sequence-based storages. + * @since 1.0.0 + * + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\FrontMutation + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\BackMutation + */ +interface DequeMutation extends FrontMutation, BackMutation {} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.FrontInsertion.php b/src/support/datastructure/storage/capability/firehub.FrontInsertion.php new file mode 100644 index 00000000..692b62b5 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.FrontInsertion.php @@ -0,0 +1,38 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Front Insertion + * + * Provides the ability to insert one or more elements at the logical start the structure in constant time. + * @since 1.0.0 + * + * @template TValue + */ +interface FrontInsertion { + + /** + * ### Prepend values to the front + * @since 1.0.0 + * + * @param TValue ...$values

+ * List of values to add to the front of the storage. + *

+ * + * @return static The modified storage structure. + */ + public function addFirst (mixed ...$values):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.FrontMutation.php b/src/support/datastructure/storage/capability/firehub.FrontMutation.php new file mode 100644 index 00000000..9258e9e4 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.FrontMutation.php @@ -0,0 +1,26 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Front Mutation Capability + * + * Combines front insertion and front removal, enabling full mutation of the logical start of the structure. + * @since 1.0.0 + * + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\FrontInsertion + */ +interface FrontMutation extends FrontInsertion, FrontRemoval {} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.FrontRemoval.php b/src/support/datastructure/storage/capability/firehub.FrontRemoval.php new file mode 100644 index 00000000..99c33d2f --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.FrontRemoval.php @@ -0,0 +1,36 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Front Removal + * + * Provides the ability to remove one or more elements from the logical start of the structure in constant time. + * @since 1.0.0 + */ +interface FrontRemoval { + + /** + * ### Removes values from the front + * @since 1.0.0 + * + * @param int $items [optional]

+ * Number of values to remove from the front of the storage. + *

+ * + * @return static The modified storage structure. + */ + public function removeFirst (int $items = 1):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.IndexAccess.php b/src/support/datastructure/storage/capability/firehub.IndexAccess.php new file mode 100644 index 00000000..8d4ffbe7 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.IndexAccess.php @@ -0,0 +1,65 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Shared\Type\Maybe; + +/** + * ### Positional Index Access Capability + * + * A storage capability that provides read-only access to elements based on their positional index within a linear + * structure. It enables safe retrieval and existence checks over ordered collections such as arrays, lists, fixed-size + * buffers, and ring buffers. The abstraction assumes a dense or logically mapped index space where each integer index + * represents a position rather than an identity or key. + * @since 1.0.0 + * + * @template TValue + */ +interface IndexAccess { + + /** + * ### Check Index Existence + * + * Determines whether a valid element exists at the given positional index. This operation does not retrieve the + * value and is optimized for fast boundary or presence checks within indexed storage structures. + * @since 1.0.0 + * + * @param int $index

+ * The key to check for existence. + *

+ * + * @return bool True if the key exists, false otherwise. + */ + public function has (int $index):bool; + + /** + * ### Retrieve Value by Index + * + * Returns the value located at the specified positional index within the storage. If the index does not exist or + * is out of bounds, an empty Maybe is returned. This operation provides safe, read-only access to ordered storage + * without exposing internal structure or requiring direct array access. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * + * @param int $index

+ * The key to retrieve value by index. + *

+ * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with element at index + * position of the storage, or Maybe with null if element at index position of the storage doesn't exist. + */ + public function get (int $index):Maybe; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.IndexMutation.php b/src/support/datastructure/storage/capability/firehub.IndexMutation.php new file mode 100644 index 00000000..862fcaa0 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.IndexMutation.php @@ -0,0 +1,72 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Shared\Enums\MutationOutcome; + +/** + * ### Positional Index Mutation Capability + * + * A storage capability that enables modification of elements based on their positional index within a linear + * structure. It defines write and removal operations over indexed storage models such as arrays, lists, fixed + * buffers, and ring buffers. The abstraction assumes a positional addressing scheme where integer indexes represent + * logical positions rather than identity or key-based mappings. + * @since 1.0.0 + * + * @template TValue + */ +interface IndexMutation { + + /** + * ### Set Value at Index + * + * Assigns a value to the specified positional index in the storage. If the index already contains a value, it is + * overwritten according to the storage’s mutation semantics. This operation assumes a valid index-based + * addressing model and does not perform key resolution or structural lookup. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * + * @param int $index

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the index. + *

+ * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::CREATED|\FireHub\Core\Shared\Enums\MutationOutcome::UPDATED + * An enum indicating the result of the mutation operation. + */ + public function set (int $index, mixed $value):MutationOutcome; + + /** + * ### Remove Value by Index + * + * Removes the element located at the specified index. The behavior after removal depends on the storage + * implementation (e.g., shifting in lists, pulling in fixed storage, or logical repositioning in ring buffers). + * This operation affects structural layout but not value semantics directly. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * + * @param int $index

+ * The key of the value to remove. + *

+ * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::REMOVED|\FireHub\Core\Shared\Enums\MutationOutcome::NOT_FOUND + * An enum indicating the result of the mutation operation. + */ + public function remove (int $index):MutationOutcome; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.KeyAccess.php b/src/support/datastructure/storage/capability/firehub.KeyAccess.php new file mode 100644 index 00000000..470805dd --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.KeyAccess.php @@ -0,0 +1,67 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Shared\Type\Maybe; + +/** + * ### Key-Based Read Access Capability + * + * A storage capability that provides read-only access to elements identified by a key (string or integer). It + * enables safe retrieval and existence checks without exposing mutation operations or internal storage structure. + * Designed for associative data structures such as maps, registries, and indexed key-value stores where lookup + * semantics are primary and structural details remain encapsulated. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + */ +interface KeyAccess { + + /** + * ### Check Key Existence + * + * Determines whether a value exists for the specified key in the storage. Provides a fast existence check + * without retrieving the underlying value, enabling safe conditional access patterns. + * @since 1.0.0 + * + * @param TKey $key

+ * The key to check for existence. + *

+ * + * @return bool True if the key exists, false otherwise. + */ + public function has (int|string $key):bool; + + /** + * ### Retrieve Value by Key + * + * Retrieves the value associated with the given key from an associative storage structure. If the key does not + * exist, an empty Maybe is returned instead of null, ensuring explicit handling of missing entries. This operation + * does not modify the storage and is designed for safe, read-only access to key-based data mappings such as + * dictionaries, maps, and registries. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * + * @param TKey $key

+ * The key to retrieve value by key. + *

+ * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with element at key + * position of the storage, or Maybe with null if element at key position of the storage doesn't exist. + */ + public function get (int|string $key):Maybe; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.KeyMutation.php b/src/support/datastructure/storage/capability/firehub.KeyMutation.php new file mode 100644 index 00000000..5274739b --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.KeyMutation.php @@ -0,0 +1,73 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Shared\Enums\MutationOutcome; + +/** + * ### Associative Key Mutation Capability + * + * A storage capability that enables modification of elements based on associative keys (string or integer + * identifiers). It defines write and removal operations over key-value storage models such as maps, dictionaries, + * and registries. The abstraction assumes a key-based addressing scheme where keys represent stable identifiers + * rather than positional indexes. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + */ +interface KeyMutation { + + /** + * ### Set Value by Key + * + * Assigns a value to the specified key in the associative storage. If the key already exists, the existing + * value is overwritten. If it does not exist, a new entry is created. This operation is fundamental for + * key-value-based structures and does not involve positional logic or traversal. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * + * @param TKey $key

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the key. + *

+ * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::CREATED|\FireHub\Core\Shared\Enums\MutationOutcome::UPDATED + * An enum indicating the result of the mutation operation. + */ + public function set (int|string $key, mixed $value):MutationOutcome; + + /** + * ### Remove Value by Key + * + * Removes the entry associated with the specified key from the storage. If the key does not exist, the operation + * has no effect. This mutation affects only the associative mapping layer and does not depend on element ordering + * or structural position. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * + * @param TKey $key

+ * The key of the value to remove. + *

+ * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::REMOVED|\FireHub\Core\Shared\Enums\MutationOutcome::NOT_FOUND + * An enum indicating the result of the mutation operation. + */ + public function remove (int|string $key):MutationOutcome; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.LinearBoundaryAccess.php b/src/support/datastructure/storage/capability/firehub.LinearBoundaryAccess.php new file mode 100644 index 00000000..e5e24b0c --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.LinearBoundaryAccess.php @@ -0,0 +1,54 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Shared\Type\Maybe; + +/** + * ### Linear Boundary Access Capability + * + * Defines the ability for a storage implementation to provide direct access to the boundaries + * of a linear sequence. This includes retrieving the first element and the last element without requiring full + * traversal of the underlying data. Intended as an optional optimization layer for linear structures where boundary + * access can be performed in constant time, while maintaining separation between storage concerns and data structure + * semantics. + * @since 1.0.0 + * + * @template TValue + */ +interface LinearBoundaryAccess { + + /** + * ### Retrieve the first element + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with first element + * of the storage, or Maybe with null if storage is empty. + */ + public function first ():Maybe; + + /** + * ### Retrieve the last element + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with last element + * of the storage, or Maybe with null if storage is empty. + */ + public function last ():Maybe; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.NodeAccess.php b/src/support/datastructure/storage/capability/firehub.NodeAccess.php new file mode 100644 index 00000000..c18187a8 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.NodeAccess.php @@ -0,0 +1,62 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle; + +/** + * ### Node Handle Access Capability + * + * Defines a read-only capability for accessing structural positions within a node-based storage system through + * NodeHandle references. It provides safe entry points into the internal topology without exposing raw nodes or + * traversal logic. This interface is intended exclusively for storage implementations that are based on explicit node + * structures such as linked lists, trees, or graph-like systems. + * @since 1.0.0 + * + * @template TValue + */ +interface NodeAccess { + + /** + * ### Retrieve First Node Handle + * + * Returns a NodeHandle representing the first logical element in the storage structure. The definition of + * “first” depends on the underlying topology (e.g. head in linked lists or root-like entry in hierarchical + * structures). Returns null if the structure is empty. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle As return. + * + * @return null|\FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle NodeHandle with value at the + * first position in the storage, or null if the structure is empty. + */ + public function firstNode ():?NodeHandle; + + /** + * ### Retrieve Last Node Handle + * + * Returns a NodeHandle representing the last logical element in the storage structure. Applicable primarily to + * ordered or linear node-based structures such as linked lists or deque-based implementations. Returns null if the + * structure is empty. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle As return. + * + * @return null|\FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle NodeHandle with value at the + * last position in the storage, or null if the structure is empty. + */ + public function lastNode ():?NodeHandle; + + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.NodeBidirectionalInsert.php b/src/support/datastructure/storage/capability/firehub.NodeBidirectionalInsert.php new file mode 100644 index 00000000..546d4ae3 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.NodeBidirectionalInsert.php @@ -0,0 +1,29 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Bidirectional Node Insertion Capability + * + * A composite capability that combines both forward (after) and backward (before) node insertion operations. It + * represents full positional insertion control within a node-based storage topology and is typically supported by + * doubly linked structures. + * @since 1.0.0 + * + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\NodeInsertBefore + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\NodeInsertAfter + */ +interface NodeBidirectionalInsert extends NodeInsertBefore, NodeInsertAfter {} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.NodeInsertAfter.php b/src/support/datastructure/storage/capability/firehub.NodeInsertAfter.php new file mode 100644 index 00000000..d921661e --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.NodeInsertAfter.php @@ -0,0 +1,50 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle; + +/** + * ### Post-Node Insertion Capability + * + * Defines the ability to insert a node directly after a given target node within a pointer-based storage structure. + * This operation assumes the existence of forward-linking topology and is typically O(1) in singly, doubly, and + * circular linked structures. + * @since 1.0.0 + * + * @template TValue + */ +interface NodeInsertAfter { + + /** + * ### Insert a node after a target node + * + * Inserts a new node immediately after the specified target node, updating internal links to maintain structural + * consistency. Operates in O(1) for linked implementations where node references are directly accessible. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle As parameter and return. + * + * @param \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle $target

+ * The node after which the new node will be inserted. + *

+ * @param TValue $value

+ * The value to be inserted. + *

+ * + * @return \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle New node handle. + */ + public function insertAfter (NodeHandle $target, mixed $value):NodeHandle; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.NodeInsertBefore.php b/src/support/datastructure/storage/capability/firehub.NodeInsertBefore.php new file mode 100644 index 00000000..b069a057 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.NodeInsertBefore.php @@ -0,0 +1,50 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle; + +/** + * ### Pre-Node Insertion Capability + * + * Defines the ability to insert a node directly before a given target node. This operation requires backward + * navigation or traversal support and is naturally supported in doubly linked structures, while potentially O(n) in + * singly linked implementations. + * @since 1.0.0 + * + * @template TValue + */ +interface NodeInsertBefore { + + /** + * ### Insert a node before a target node + * + * Inserts a new node immediately before the specified target node. Requires traversal in singly linked + * structures but operates in O(1) for doubly linked implementations where backward references are available. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle As parameter and return. + * + * @param \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle $target

+ * The node before which the new node will be inserted. + *

+ * @param TValue $value

+ * The value to be inserted. + *

+ * + * @return \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle New node handle. + */ + public function insertBefore (NodeHandle $target, mixed $value):NodeHandle; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.NodeMutation.php b/src/support/datastructure/storage/capability/firehub.NodeMutation.php new file mode 100644 index 00000000..da2f800e --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.NodeMutation.php @@ -0,0 +1,29 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Full Node Mutation Capability + * + * A composite capability that represents full structural mutation support for node-based storage systems. It + * combines bidirectional insertion and node removal capabilities, enabling complete topological control over a linked + * structure. Typically implemented by doubly linked or a circular linked storages. + * @since 1.0.0 + * + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\NodeBidirectionalInsert + * @extends \FireHub\Core\Support\DataStructure\Storage\Capability\NodeRemoval + */ +interface NodeMutation extends NodeBidirectionalInsert, NodeRemoval {} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.NodeRemoval.php b/src/support/datastructure/storage/capability/firehub.NodeRemoval.php new file mode 100644 index 00000000..10b09d54 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.NodeRemoval.php @@ -0,0 +1,48 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +use FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle; + +/** + * ### Node Removal Capability + * + * Defines the ability to remove a specific node from a storage structure by directly manipulating its surrounding + * links. This operation is pointer-based and allows O(1) removal in structures that maintain direct references to + * adjacent nodes. + * @since 1.0.0 + * + * @template TValue + */ +interface NodeRemoval { + + /** + * ### Remove Node from storage + * + * Removes the specified node from the storage structure and reconnects surrounding nodes to preserve continuity. + * Complexity depends on a structure type (O(1) for doubly-linked with direct reference, O(n) for singly-linked + * traversal-based removal). + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle As parameter. + * + * @param \FireHub\Core\Support\DataStructure\Storage\Handle\NodeHandle $handle

+ * The node to remove. + *

+ * + * @return static The modified storage structure. + */ + public function removeNode (NodeHandle $handle):static; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/capability/firehub.StorageMetricsAware.php b/src/support/datastructure/storage/capability/firehub.StorageMetricsAware.php new file mode 100644 index 00000000..92ca4f08 --- /dev/null +++ b/src/support/datastructure/storage/capability/firehub.StorageMetricsAware.php @@ -0,0 +1,58 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Capability; + +/** + * ### Storage Metrics Awareness Contract + * + * A unified interface that defines standardized introspection capabilities for storage structures.
+ * It provides a consistent way to access structural metrics such as the number of active elements and the maximum + * storage capacity across all FireHub data structure implementations.
+ *This contract ensures uniform observability for both bounded and unbounded storage types, enabling generic + * algorithms, diagnostics, and performance-aware operations to interact with different storage implementations + * without knowledge of their internal representation.
+ * It serves as a core abstraction layer for monitoring storage state, supporting operations such as utilization + * analysis, capacity planning, and runtime optimization decisions. + * @since 1.0.0 + */ +interface StorageMetricsAware { + + /** + * ### Retrieve the maximum number of elements that can be stored in the storage + * @since 1.0.0 + * + * @return null|non-negative-int The maximum number of elements that can be stored in the storage, or null for + * unbounded storage. + */ + public function capacity ():?int; + + /** + * ### Retrieve the remaining capacity that can be used in the storage + * + * @since 1.0.0 + * + * @return null|non-negative-int The remaining capacity that can be used in the storage, or null for unbounded + * storage. + */ + public function availableCapacity ():?int; + + /** + * ### Retrieve the number of elements stored in the storage + * @since 1.0.0 + * + * @return non-negative-int The number of elements stored in the storage. + */ + public function size ():int; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/engine/firehub.ArrHashEngine.php b/src/support/datastructure/storage/engine/firehub.ArrHashEngine.php new file mode 100644 index 00000000..3d6ceb46 --- /dev/null +++ b/src/support/datastructure/storage/engine/firehub.ArrHashEngine.php @@ -0,0 +1,133 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.1 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Engine; + +use FireHub\Core\Support\DataStructure\Storage\HashEngine; +use FireHub\Core\Shared\Type\Maybe; +use FireHub\Core\Shared\Enums\MutationOutcome; +use FireHub\Core\Support\LowLevel\Arr; + +/** + * ### Array Hash Engine + * + * Simple PHP array-backed hash table engine.
+ * Fast, memory-resident, no collision strategy beyond PHP array behavior. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage\HashEngine + */ +final class ArrHashEngine implements HashEngine { + + /** + * ### Underlying data + * @since 1.0.0 + * + * @var array + */ + private array $data = []; + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function iterate ():iterable { + + return $this->data; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::count() To count the number of elements in the storage. + */ + public function size ():int { + + return Arr::count($this->data); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::keyExists() To check if a key exists in the hash engine. + */ + public function has (int|string $key):bool { + + return Arr::keyExists($key, $this->data); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\ArrMapStorage::has() To check if key exists. + */ + public function get (int|string $key):Maybe { + + return $this->has($key) + ? Maybe::some($this->data[$key]) // @phpstan-ignore offsetAccess.notFound + : Maybe::none(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\ArrListStorage::has() To check if index exists. + */ + public function set (int|string $key, mixed $value):MutationOutcome { + + $exists = $this->has($key); + + $this->data[$key] = $value; + + return $exists + ? MutationOutcome::UPDATED + : MutationOutcome::CREATED; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\ArrListStorage::has() To check if index exists. + */ + public function remove (int|string $key):MutationOutcome { + + $exists = $this->has($key); + + unset($this->data[$key]); + + return $exists + ? MutationOutcome::REMOVED + : MutationOutcome::NOT_FOUND; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/firehub.GeneratorStorage.php b/src/support/datastructure/storage/firehub.GeneratorStorage.php new file mode 100644 index 00000000..81d8f9c5 --- /dev/null +++ b/src/support/datastructure/storage/firehub.GeneratorStorage.php @@ -0,0 +1,82 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage; + +use FireHub\Core\Support\DataStructure\Storage; +use FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer; +use FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\GeneratorCallbackInitializer; +use FireHub\Core\Support\DataStructure\Storage\Capability\Convertible; + +/** + * ### Lazy Generator-Based Storage + * + * A read-optimized storage implementation based on PHP generators. Designed for streaming large or infinite datasets + * where materialization is not required. Does not guarantee rewinding or persistent state beyond iteration, making + * it suitable for pipeline-based or lazy evaluation scenarios. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible + */ +final readonly class GeneratorStorage implements Storage, Convertible { + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer As parameter. + * + * @param \FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer $initializer

+ * Initial data to store. + *

+ * + * @return void + */ + public function __construct ( + private GeneratorStorageInitializer $initializer + ) {} + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\GeneratorCallbackInitializer To + * convert the storage to a generator. + * @uses \FireHub\Core\Support\DataStructure\Storage::iterate() To retrieve an iterable of the elements in the + * storage. + */ + public static function fromStorage (Storage $storage):static { + + return new self( + new GeneratorCallbackInitializer(fn() => yield from $storage->iterate()) + ); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function iterate ():iterable { + + return ($this->initializer)(); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/firehub.HashEngine.php b/src/support/datastructure/storage/firehub.HashEngine.php new file mode 100644 index 00000000..1e149860 --- /dev/null +++ b/src/support/datastructure/storage/firehub.HashEngine.php @@ -0,0 +1,123 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage; +use FireHub\Core\Shared\Type\Maybe; +use FireHub\Core\Shared\Enums\MutationOutcome; + +/** + * ### Hash Engine Contract + * + * Low-level storage strategy for HashStorage.
+ * Responsible for actual key-value persistence logic. + * + * @template TKey of int|string + * @template TValue + */ +interface HashEngine { + + /** + * ### Traverses Hash Engine data + * + * Provides a unified, read-only traversal contract for accessing all elements within a Hash Engine implementation. + * @since 1.0.0 + * + * @return iterable + */ + public function iterate ():iterable; + + /** + * ### Retrieve the number of elements stored in the hash engine + * @since 1.0.0 + * + * @return non-negative-int The number of elements stored in the hash engine. + */ + public function size ():int; + + /** + * ### Check Key Existence + * + * Determines whether a value exists for the specified key in the hash engine. Provides a fast existence check + * without retrieving the underlying value, enabling safe conditional access patterns. + * @since 1.0.0 + * + * @param TKey $key

+ * The key to check for existence. + *

+ * + * @return bool True if the key exists, false otherwise. + */ + public function has (int|string $key):bool; + + /** + * ### Retrieve Value by Key + * + * Retrieves the value associated with the given key from an associative hash engine. If the key does not + * exist, an empty Maybe is returned instead of null, ensuring explicit handling of missing entries. This operation + * does not modify the hash engine and is designed for safe, read-only access to key-based data mappings such as + * dictionaries, maps, and registries. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * + * @param TKey $key

+ * The key to retrieve value by key. + *

+ * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with element at key + * position of the hash engine, or Maybe with null if element at key position of the hash engine doesn't exist. + */ + public function get (int|string $key):Maybe; + + /** + * ### Set Value by Key + * + * Assigns a value to the specified key in the associative hash engine. If the key already exists, the existing + * value is overwritten. If it does not exist, a new entry is created. This operation is fundamental for + * key-value-based structures and does not involve positional logic or traversal. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * + * @param TKey $key

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the key. + *

+ * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::CREATED|\FireHub\Core\Shared\Enums\MutationOutcome::UPDATED + * An enum indicating the result of the mutation operation. + */ + public function set (int|string $key, mixed $value):MutationOutcome; + + /** + * ### Remove Value by Key + * + * Removes the entry associated with the specified key from the hash engine. If the key does not exist, the operation + * has no effect. This mutation affects only the associative mapping layer and does not depend on element ordering + * or structural position. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * + * @param TKey $key

+ * The key of the value to remove. + *

+ * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::REMOVED|\FireHub\Core\Shared\Enums\MutationOutcome::NOT_FOUND + * An enum indicating the result of the mutation operation. + */ + public function remove (int|string $key):MutationOutcome; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/firehub.HashStorage.php b/src/support/datastructure/storage/firehub.HashStorage.php new file mode 100644 index 00000000..5992e410 --- /dev/null +++ b/src/support/datastructure/storage/firehub.HashStorage.php @@ -0,0 +1,239 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage; + +use FireHub\Core\Support\DataStructure\Storage; +use FireHub\Core\Support\DataStructure\Storage\Capability\ { + Cloneable, Convertible, KeyAccess, KeyMutation, StorageMetricsAware +}; +use FireHub\Core\Support\DataStructure\Storage\Engine\ArrHashEngine; +use FireHub\Core\Shared\Type\Maybe; +use FireHub\Core\Shared\Enums\MutationOutcome; +use FireHub\Core\Throwable\Exception\Support\DataStructure\ { + InvalidEngineException, InvalidKeyException +}; +use FireHub\Core\Support\LowLevel\ { + ClsObj, DataIs +}; + +/** + * ### Hash-based Key-Value Storage with Pluggable Engine Architecture + * + * A key-value storage abstraction that provides associative data management using a pluggable hashing engine. It + * decouples the storage API from the underlying implementation (such as array-based maps, HAMT, open addressing, or + * Robin Hood hashing), allowing runtime strategy switching while preserving consistent Map/Set semantics. + * + * @template TKey of array-key + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\KeyAccess + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\KeyMutation + */ +final readonly class HashStorage implements Storage, Convertible, Cloneable, StorageMetricsAware, KeyAccess, + KeyMutation { + + /** + * ### Hash Engine + * @since 1.0.0 + * + * @var \FireHub\Core\Support\DataStructure\Storage\HashEngine + */ + private HashEngine $engine; + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine As parameter. + * @uses \FireHub\Core\Support\DataStructure\Storage\Engine\ArrHashEngine As default hash engine. + * + * @param null|\FireHub\Core\Support\DataStructure\Storage\HashEngine $engine [optional]

+ * Hash Engine. + *

+ * + * @return void + */ + public function __construct (?HashEngine $engine = null) { + + $this->engine = $engine ?? new ArrHashEngine(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage::iterate() To retrieve an iterable of the elements in the + * storage. + * + * @param class-string<\FireHub\Core\Support\DataStructure\Storage\HashEngine> $engine [optional]

+ * Hash engine to use. + *

+ * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException If key is invalid. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidEngineException If engine is invalid. + */ + public static function fromStorage (Storage $storage, string $engine = Storage\Engine\ArrHashEngine::class):static { + + $engine = ClsObj::ofClass($engine, HashEngine::class) + ? new $engine + : throw InvalidEngineException::builder() + ->withContext([ + 'engine' => $engine + ]) + ->build(); + + foreach ($storage->iterate() as $key => $value) { + + if (!DataIs::int($key) && !DataIs::string($key)) + throw InvalidKeyException::builder() + ->withContext([ + 'key' => $key + ]) + ->build(); + + $engine->set($key, $value); + + } + + + return new self($engine); // @phpstan-ignore return.type + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine::iterate() To traverse Hash Engine data. + */ + public function iterate ():iterable { + + return $this->engine->iterate(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine::iterate() To traverse hash engine data. + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine::set() To set Value by Key in the engine. + */ + public function copy ():static { + + $engine = new $this->engine; + + foreach ($this->engine->iterate() as $key => $value) + $engine->set($key, $value); + + return new self($engine); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function capacity ():null { + + return null; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function availableCapacity ():null { + + return null; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine::size() To get number of elements stored in the + * hash engine. + */ + public function size ():int { + + return $this->engine->size(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine::has() To check Key existence in the engine. + */ + public function has (int|string $key):bool { + + return $this->engine->has($key); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashStorage::get() To check if key exists in the engine. + */ + public function get (int|string $key):Maybe { + + return $this->engine->get($key); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashStorage::set() To set Value by Key in the engine. + */ + public function set (int|string $key, mixed $value):MutationOutcome { + + return $this->engine->set($key, $value); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\HashEngine::remove() To remove Value by Key in the engine. + */ + public function remove (int|string $key):MutationOutcome { + + return $this->engine->remove($key); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/firehub.ListStorage.php b/src/support/datastructure/storage/firehub.ListStorage.php new file mode 100644 index 00000000..437df400 --- /dev/null +++ b/src/support/datastructure/storage/firehub.ListStorage.php @@ -0,0 +1,332 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.1 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage; + +use FireHub\Core\Support\DataStructure\Storage; +use FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer; +use FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListCallbackInitializer; +use FireHub\Core\Support\DataStructure\Storage\Capability\ { + Cloneable, Convertible, DequeMutation, IndexAccess, IndexMutation, LinearBoundaryAccess, StorageMetricsAware +}; +use FireHub\Core\Shared\Type\Maybe; +use FireHub\Core\Shared\Enums\MutationOutcome; +use FireHub\Core\Support\LowLevel\ { + Arr, Math +}; + +/** + * ### Array-Based List Storage + * + * A mutable sequential storage implementation backed by a native array structure. Represents an ordered list of + * elements with integer-indexed access and preserves insertion order. Supports fast append operations, indexed + * mutation, and controlled front and back insertions/removals with predictable performance characteristics. Designed + * for general-purpose list-based collections where ordered iteration and positional access are primary requirements. + * @since 1.0.0 + * + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\LinearBoundaryAccess + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\DequeMutation + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\IndexAccess + * @implements \FireHub\Core\Support\DataStructure\Storage\Capability\IndexMutation + */ +final class ListStorage implements Storage, Convertible, Cloneable, StorageMetricsAware, LinearBoundaryAccess, + DequeMutation, IndexAccess, IndexMutation { + + /** + * ### Underlying data storage + * @since 1.0.0 + * + * @var array + */ + private array $data = []; + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer As parameter. + * @uses \FireHub\Core\Support\LowLevel\Arr::values() To convert the array keys to integers. + * + * @param null|\FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer $initializer [optional]

+ * Initial data to store. + *

+ * + * @return void + */ + public function __construct (?ListStorageInitializer $initializer = null) { + + if ($initializer !== null) $this->data = Arr::values($initializer()); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy\ListCallbackInitializer To + * convert the storage to an array. + * @uses \FireHub\Core\Support\DataStructure\Storage::iterate() To retrieve an iterable of the elements in the + * storage. + */ + public static function fromStorage (Storage $storage):static { + + return new self( + new ListCallbackInitializer(function () use ($storage) { + + $values = []; + foreach ($storage->iterate() as $value) + $values[] = $value; + + return $values; + + }) + ); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function iterate ():iterable { + + /** @var array */ + return $this->data; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function copy ():static { + + $clone = new static(); + + $clone->data = []; + + foreach ($this->data as $value) + $clone->data[] = $value; + + /** @var static */ + return $clone; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function capacity ():null { + + return null; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function availableCapacity ():null { + + return null; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::count() To count the number of elements in the storage. + */ + public function size ():int { + + return Arr::count($this->data); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::first() To get the first element in the storage. + */ + public function first ():Maybe { + + if ($this->data === []) return Maybe::none(); + + /** @var TValue $first */ + $first = Arr::first($this->data); + + return Maybe::some($first); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::last() To get the last element in the storage. + */ + public function last ():Maybe { + + if ($this->data === []) return Maybe::none(); + + /** @var TValue $last */ + $last = Arr::last($this->data); + + return Maybe::some($last); + + } + + /** + * @inheritDoc + * + * @uses \FireHub\Core\Support\LowLevel\Arr::unshift() To prepend values to the beginning of the array. + * + * @since 1.0.0 + */ + public function addFirst (mixed ...$values):static { + + Arr::unshift($this->data, ...$values); + + return $this; + + } + + /** + * @inheritDoc + * + * @uses \FireHub\Core\Support\LowLevel\Arr::push() To append values to the end of the array. + * + * @since 1.0.0 + */ + public function addLast (mixed ...$values):static { + + Arr::push($this->data, ...$values); + + return $this; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::slice() To remove first items from the array. + * @uses \FireHub\Core\Support\LowLevel\Math::max() To ensure the number of items to remove is not negative. + */ + public function removeFirst (int $items = 1):static { + + $this->data = Arr::slice($this->data, Math::max($items, 0)); + + return $this; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::pop() To remove last items from the array. + */ + public function removeLast (int $items = 1):static { + + while ($items-- > 0) + Arr::pop($this->data); + + return $this; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::keyExists() To check if a key exists in the storage. + */ + public function has (int $index):bool { + + return Arr::keyExists($index, $this->data); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\ListStorage::has() To check if index exists. + */ + public function get (int $index):Maybe { + + return $this->has($index) + ? Maybe::some($this->data[$index]) // @phpstan-ignore offsetAccess.notFound + : Maybe::none(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\ListStorage::has() To check if index exists. + */ + public function set (int $index, mixed $value):MutationOutcome { + + $outcome = $this->has($index) + ? MutationOutcome::UPDATED + : MutationOutcome::CREATED; + + $this->data[$index] = $value; + + return $outcome; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\ListStorage::has() To check if index exists. + */ + public function remove (int $index):MutationOutcome { + + $outcome = $this->has($index) + ? MutationOutcome::REMOVED + : MutationOutcome::NOT_FOUND; + + unset($this->data[$index]); + + return $outcome; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/firehub.Node.php b/src/support/datastructure/storage/firehub.Node.php new file mode 100644 index 00000000..054367b2 --- /dev/null +++ b/src/support/datastructure/storage/firehub.Node.php @@ -0,0 +1,47 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage; + +use FireHub\Core\Support\DataStructure\Storage; + +/** + * ### Base Storage Node Contract + * + * A minimal structural contract representing a node inside a storage implementation. It defines only value ownership + * semantics without imposing any constraints on linkage, traversal, or topology. + * @since 1.0.0 + * + * @template TValue + */ +interface Node { + + /** + * ### Retrieves the storage instance that owns this node + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage As return. + * + * @return \FireHub\Core\Support\DataStructure\Storage Storage instance that owns this node. + */ + public function owner ():Storage; + + /** + * ### Get the value contained in this node + * @since 1.0.0 + * + * @return TValue The value contained in this node. + */ + public function value ():mixed; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/handle/firehub.NodeHandle.php b/src/support/datastructure/storage/handle/firehub.NodeHandle.php new file mode 100644 index 00000000..3fe4d007 --- /dev/null +++ b/src/support/datastructure/storage/handle/firehub.NodeHandle.php @@ -0,0 +1,59 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Handle; + +use FireHub\Core\Support\DataStructure\Storage\Node; + +/** + * ### Opaque Storage Node Handle + * + * A lightweight, immutable reference that uniquely identifies and encapsulates a node within a storage structure. + * The handle acts as a stable external pointer to an internal node without exposing its implementation details or + * allowing direct structural manipulation. It is bound to a specific storage instance and is intended to be used as a + * safe token for node-based operations such as mutation, retrieval, or structural navigation through controlled APIs. + * NodeHandle does not provide traversal capabilities and does not represent a cursor in the navigational sense. + * Instead, it serves purely as an identity-safe bridge between external API consumers and internal storage topology. + * @since 1.0.0 + * + * @template TValue + */ +final readonly class NodeHandle { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param \FireHub\Core\Support\DataStructure\Storage\Node $node

+ * The node to be encapsulated by the handle. + *

+ * + * @return void + */ + public function __construct ( + private Node $node + ) {} + + /** + * ### Get encapsulated node + * @since 1.0.0 + * + * @return \FireHub\Core\Support\DataStructure\Storage\Node Encapsulated node. + */ + public function node ():Node { + + return $this->node; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/initialization/firehub.GeneratorStorageInitializer.php b/src/support/datastructure/storage/initialization/firehub.GeneratorStorageInitializer.php new file mode 100644 index 00000000..0a68325c --- /dev/null +++ b/src/support/datastructure/storage/initialization/firehub.GeneratorStorageInitializer.php @@ -0,0 +1,39 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Initialization; + +use Generator; + +/** + * ### Generator Storage Initializer + * + * Defines a contract for initializing generator-based storage by producing an iterable data stream. Enables + * deferred, memory-efficient data provisioning through generators while maintaining a consistent and encapsulated + * initialization interface for streaming storage implementations. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface GeneratorStorageInitializer { + + /** + * ### Invoke Initializer + * @since 1.0.0 + * + * @return Generator Underlying data for storage. + */ + public function __invoke ():Generator; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/initialization/firehub.ListStorageInitializer.php b/src/support/datastructure/storage/initialization/firehub.ListStorageInitializer.php new file mode 100644 index 00000000..2e418885 --- /dev/null +++ b/src/support/datastructure/storage/initialization/firehub.ListStorageInitializer.php @@ -0,0 +1,38 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Initialization; + +/** + * ### List Storage Initializer + * + * Provides a strategy for initializing the internal array of an ListStorage instance during construction. Enables + * controlled, potentially lazy, or computed population of the underlying data structure while preserving encapsulation + * and avoiding direct array injection. Suitable for large datasets, dynamic generation, or deferred materialization + * patterns. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + */ +interface ListStorageInitializer { + + /** + * ### Invoke Initializer + * @since 1.0.0 + * + * @return array Underlying data for storage. + */ + public function __invoke ():array; + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/initialization/strategy/firehub.GeneratorCallbackInitializer.php b/src/support/datastructure/storage/initialization/strategy/firehub.GeneratorCallbackInitializer.php new file mode 100644 index 00000000..109bdff7 --- /dev/null +++ b/src/support/datastructure/storage/initialization/strategy/firehub.GeneratorCallbackInitializer.php @@ -0,0 +1,59 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy; + +use FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer; +use Closure, Generator; + +/** + * ### Generator Callback Initializer + * + * A concrete GeneratorStorageInitializer implementation that delegates data stream creation to a user-provided + * callback. Executes the callback to return a generator or iterable sequence, allowing dynamic, lazy, and + * memory-efficient data generation while preserving a uniform initialization contract. + * @since 1.0.0 + * + * @template TKey + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage\Initialization\GeneratorStorageInitializer + */ +final readonly class GeneratorCallbackInitializer implements GeneratorStorageInitializer { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param Closure():Generator $callback

+ * A callback function that returns an Generator of key-value pairs to be used as the underlying dataset. + *

+ * + * @return void + */ + public function __construct( + private Closure $callback + ) {} + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function __invoke ():Generator { + + return ($this->callback)(); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/initialization/strategy/firehub.ListCallbackInitializer.php b/src/support/datastructure/storage/initialization/strategy/firehub.ListCallbackInitializer.php new file mode 100644 index 00000000..ff938623 --- /dev/null +++ b/src/support/datastructure/storage/initialization/strategy/firehub.ListCallbackInitializer.php @@ -0,0 +1,59 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy; + +use FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer; +use Closure; + +/** + * ### Initialize an array using a value-generating callback + * + * A concrete ListStorageInitializer implementation that delegates array creation to a user-provided callback. + * Executes the callback during initialization to produce the underlying dataset, enabling flexible, dynamic, or + * computed data generation while preserving a consistent initialization contract. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer + */ +final readonly class ListCallbackInitializer implements ListStorageInitializer { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param Closure():array $callback

+ * A callback function that returns an array of key-value pairs to be used as the underlying dataset. + *

+ * + * @return void + */ + public function __construct( + private Closure $callback + ) {} + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function __invoke ():array { + + return ($this->callback)(); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/initialization/strategy/firehub.ListFillInitializer.php b/src/support/datastructure/storage/initialization/strategy/firehub.ListFillInitializer.php new file mode 100644 index 00000000..7b2816da --- /dev/null +++ b/src/support/datastructure/storage/initialization/strategy/firehub.ListFillInitializer.php @@ -0,0 +1,71 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy; + +use FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer; +use FireHub\Core\Support\LowLevel\Arr; + +/** + * ### Initialize an array by filling it with a repeated value + * + * Creates an array of a defined size where each element is initialized with the same value. Useful for pre-allocating + * collections, setting default states, or bootstrapping predictable datasets (e.g., fixed-size buffers, placeholders, + * or test fixtures). The initializer ensures consistent indexing and value assignment across the entire range, + * providing a fast and deterministic way to populate storage. + * @since 1.0.0 + * + * @template TValue + * + * @implements \FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer + */ +final readonly class ListFillInitializer implements ListStorageInitializer { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param TValue $value

+ * Value to use for filling. + *

+ * @param int $start_index

+ * The first index of the returned array. + *

+ * @param int<0, 2147483647> $length

+ * Number of elements to insert. Must be greater than or equal to zero. + *

+ * + * @return void + */ + public function __construct( + private mixed $value, + private int $start_index, + private int $length + ) {} + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::fill() To fill an array with values. + * + * @throws \FireHub\Core\Throwable\Error\LowLevel\Arr\OutOfRangeError If $length is out of range. + */ + public function __invoke ():array { + + return Arr::fill($this->value, $this->start_index, $this->length); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/storage/initialization/strategy/firehub.ListRangeInitializer.php b/src/support/datastructure/storage/initialization/strategy/firehub.ListRangeInitializer.php new file mode 100644 index 00000000..8deb8c1b --- /dev/null +++ b/src/support/datastructure/storage/initialization/strategy/firehub.ListRangeInitializer.php @@ -0,0 +1,95 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Storage\Initialization\Strategy; + +use FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer; +use FireHub\Core\Throwable\Exception\Support\DataStructure\OutOfBoundsException; +use FireHub\Core\Throwable\Error\LowLevel\Arr\OutOfRangeError; +use FireHub\Core\Support\LowLevel\Arr; + +/** + * ### Generate a sequential array from a numeric or string range + * + * Creates a contiguous sequence of values between a defined start and end boundary, optionally using a custom step. + * Useful for quickly bootstrapping collections with predictable numeric keys or values (e.g., index ranges, pagination + * offsets, test datasets). The initializer ensures consistent ordering and supports both ascending and descending + * ranges, depending on the provided step. + * @since 1.0.0 + * + * @template TValue of float|int|string + * + * @implements \FireHub\Core\Support\DataStructure\Storage\Initialization\ListStorageInitializer + */ +final readonly class ListRangeInitializer implements ListStorageInitializer { + + /** + * ### Constructor + * @since 1.0.0 + * + * @param TValue $start

+ * The starting value of the range. + *

+ * @param TValue $end

+ * The ending value of the range. + *

+ * @param (TValue is float ? float : int|float) $step [optional]

+ * The step size between each value in the range. Defaults to 1. + *

+ * + * @return void + */ + public function __construct( + private int|float|string $start, + private int|float|string $end, + private int|float $step = 1 + ) {} + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::range() To create an array containing a range of elements. + * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\OutOfBoundsException If $step is 0, $start, $end, + * or $step is not finite, or $step is negative, but the produced range is increasing (in other words, $start <= + * $end), or if one is string, but not both. + * + * @note Character sequence values are limited to a length of one.
+ * If a length greater than one is entered only the first character is used. + */ + public function __invoke ():array { + + try { + + /** @var array */ + return Arr::range($this->start, $this->end, $this->step); + + } catch (OutOfRangeError $error) { + + throw OutOfBoundsException::builder() + ->withMessage($error->getMessage()) + ->withContext([ + 'start' => $this->start, + 'end' => $this->end, + 'step' => $this->step + ]) + ->build(); + + } + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/structure/firehub.Map.php b/src/support/datastructure/structure/firehub.Map.php new file mode 100644 index 00000000..2d35620d --- /dev/null +++ b/src/support/datastructure/structure/firehub.Map.php @@ -0,0 +1,499 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.1 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Structure; + +use FireHub\Core\Support\Contracts\DataStructure; +use FireHub\Core\Support\DataStructure\Structure\Snapshot\MapSnapshot; +use FireHub\Core\Support\DataStructure\Abstraction\Collection; +use FireHub\Core\Support\DataStructure\Type\Associative; +use FireHub\Core\Support\DataStructure\Capability\ { + Copyable, Countable, Forkable, Freezable, Rebuildable, Rehydratable, Snapshotable +}; +use FireHub\Core\Support\DataStructure\Runtime\ { + HasCopyOnWriteState, HasFreezeState, StructureState +}; +use FireHub\Core\Support\DataStructure\DTO\ { + DehydratedState, StateHeader +}; +use FireHub\Core\Support\DataStructure\Storage; +use FireHub\Core\Support\DataStructure\Storage\Capability\ { + Cloneable, KeyAccess, KeyMutation, StorageMetricsAware +}; +use FireHub\Core\Shared\Type\Maybe; +use FireHub\Core\Shared\Enums\MutationOutcome; +use FireHub\Core\Throwable\Exception\Support\DataStructure\ { + InvalidDataStructureException, InvalidKeyException, InvalidStorageException +}; +use FireHub\Core\Support\LowLevel\ClsObj; +use Traversable; + +/** + * ### Map — Key-Value Associative Data Structure + * + * A map is an associative data structure that stores values indexed by unique keys. + * It provides fast lookup, insertion, and deletion by key rather than position. + * + * Unlike linear collections (Vector, List), Map does not expose positional ordering semantics as its primary model + * but may optionally preserve insertion order depending on implementation. + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @implements \FireHub\Core\Support\Contracts\DataStructure + * @implements \FireHub\Core\Support\DataStructure\Abstraction\Collection + * @implements \FireHub\Core\Support\DataStructure\Type\Associative + * @implements \FireHub\Core\Support\DataStructure\Capability\Snapshotable + * @implements \FireHub\Core\Support\DataStructure\Capability\Rehydratable, StorageType, array{entries: array}> + * @implements \FireHub\Core\Support\DataStructure\Capability\Rebuildable + * + * @phpstan-type StorageType = (Storage&Cloneable&StorageMetricsAware&KeyAccess&KeyMutation) + */ +final class Map implements DataStructure, Collection, Associative, Copyable, Forkable, Snapshotable, Freezable, + Rehydratable, Rebuildable, Countable { + + /** + * ### Copy-On-Write State Management + * @since 1.0.0 + */ + use HasCopyOnWriteState; + + /** + * ### Mutation Freeze Control + * @since 1.0.0 + */ + use HasFreezeState; + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage As parameter. + * + * @param StorageType $storage

+ * The storage backend for the data structure. + *

+ * + * @return void + */ + public function __construct ( + protected Storage&Cloneable&StorageMetricsAware&KeyAccess&KeyMutation $storage + ) { + + $this->state = new StructureState(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function copy ():static { + + $copy = new self($this->storage->copy()); + + $copy->frozen = $this->frozen; + + return $copy; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::increaseRef() To increse shared + * ownership reference. + */ + public function fork ():static { + + $this->increaseRef(); + + return clone $this; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @return \FireHub\Core\Support\DataStructure\Structure\Snapshot\MapSnapshot Immutable snapshot of + * current state. + */ + public function snapshot ():MapSnapshot { + + $copy = new self($this->storage->copy()); + + $copy->frozen = true; + + return new MapSnapshot($copy); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + */ + public function freeze ():void { + + $this->detachIfNeeded(); + + $this->frozen = true; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function dehydrate ():DehydratedState { + + $entries = []; + + foreach ($this as $key => $value) + $entries[$key] = $value; + + /** @var DehydratedState, StorageType, array{entries: array}> */ + return new DehydratedState( + new StateHeader(1, self::class, $this->storage::class), + ['entries' => $entries] + ); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\KeyMutation::set() To set the value of a key. + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidDataStructureException If the data + * structure is not of the expected type. + */ + public static function hydrate (DehydratedState $state):static { + + if ($state->header->structure !== self::class) + throw new InvalidDataStructureException; + + $storage = new $state->header->storage(); + + foreach ($state->payload['entries'] as $key => $value) $storage->set($key, $value); + + return new self($storage); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\ClsObj::ofClass() To check if storage has Convertible interface. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible::fromStorage() To create a new + * instance of the storage. + * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidStorageException If the storage is not + * convertible. + */ + public function rebuild (string $storage):static { + + $new_storage = ClsObj::ofClass($storage, Storage\Capability\Convertible::class) + ? $storage::fromStorage($this->storage) + : throw InvalidStorageException::builder() + ->withContext( + ['storage' => $storage] + ) + ->build(); + + return new self($new_storage); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\StorageMetricsAware::size() To retrieve the number + * of elements in the storage. + */ + public function count ():int { + + return $this->storage->size(); + + } + + /** + * ### Check Key Existence + * + * Determines whether a value exists for the specified key in the structure. Provides a fast existence check + * without retrieving the underlying value, enabling safe conditional access patterns. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\KeyAccess::has() To check Key Existence in the + * storage. + * + * @param TKey $key

+ * The key to check for existence. + *

+ * + * @return bool True if the key exists, false otherwise. + */ + public function has (int|string $key):bool { + + return $this->storage->has($key); + + } + + /** + * ### Retrieve Value by Key + * + * Retrieves the value associated with the given key from an associative structure. If the key does not exist, an + * empty Maybe is returned instead of null, ensuring explicit handling of missing entries. This operation + * does not modify the structure and is designed for safe, read-only access to key-based data mappings such as + * dictionaries, maps, and registries. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\KeyAccess::get() To retrieve Value by Key in the + * storage. + * + * @param TKey $key

+ * The key to retrieve value by key. + *

+ * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with element at key + * position of the structure, or Maybe with null if element at key position of the structure doesn't exist. + */ + public function get (int|string $key):Maybe { + + return $this->storage->get($key); + + } + + /** + * ### Set Value by Key + * + * Assigns a value to the specified key in the associative storage. If the key already exists, the existing + * value is overwritten. If it does not exist, a new entry is created. This operation is fundamental for + * key-value-based structures and does not involve positional logic or traversal. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param TKey $key

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the key. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::CREATED|\FireHub\Core\Shared\Enums\MutationOutcome::UPDATED + * An enum indicating the result of the mutation operation. + */ + public function set (int|string $key, mixed $value):MutationOutcome { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + return $this->storage->set($key, $value); + + } + + /** + * ### Set Value by Key if exists + * + * Assigns a value to the specified key in the associative storage. If the key already exists, the existing + * value is overwritten. If it does not exist, a new entry is created. This operation is fundamental for + * key-value-based structures and does not involve positional logic or traversal. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Map::has() To check if value exists. + * @uses \FireHub\Core\Support\DataStructure\Structure\Map::set() To set Value at Key. + * + * @param TKey $key

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the key. + *

+ * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException If the value does not exist. + * + * @return void + */ + public function replace (int|string $key, mixed $value):void { + + $this->has($key) + ? $this->set($key, $value) + : throw InvalidKeyException::builder() + ->withContext([ + 'key' => $key + ]) + ->build(); + + } + + /** + * ### Set Value by Key if key doesn't exist + * + * Assigns a value to the specified key in the associative storage. If the key already exists, the existing + * value is overwritten. If it does not exist, a new entry is created. This operation is fundamental for + * key-value-based structures and does not involve positional logic or traversal. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Map::has() To check if value exists. + * @uses \FireHub\Core\Support\DataStructure\Structure\Map::set() To set Value at Key. + * + * @param TKey $key

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the key. + *

+ * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException If the value does not exist. + * + * @return void + */ + public function add (int|string $key, mixed $value):void { + + !$this->has($key) + ? $this->set($key, $value) + : throw InvalidKeyException::builder() + ->withContext([ + 'key' => $key + ]) + ->build(); + + } + + /** + * ### Remove Value by Key + * + * Removes the entry associated with the specified key from the storage. If the key does not exist, the operation + * has no effect. This mutation affects only the associative mapping layer and does not depend on element ordering + * or structural position. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param TKey $key

+ * The key of the value to remove. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::REMOVED|\FireHub\Core\Shared\Enums\MutationOutcome::NOT_FOUND + * An enum indicating the result of the mutation operation. + */ + public function remove (int|string $key):MutationOutcome { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + return $this->storage->remove($key); + + } + + /** + * ### Remove Value by Key if exists + * + * Removes the entry associated with the specified key from the storage. If the key does not exist, the operation + * has no effect. This mutation affects only the associative mapping layer and does not depend on element ordering + * or structural position. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector::has() To check if value exists. + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector::remove() To remove Value at Index. + * + * @param TKey $key

+ * The key of the value to remove. + *

+ * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException If the value does not exist. + * + * @return void + */ + public function delete (int|string $key):void { + + $this->has($key) + ? $this->remove($key) + : throw InvalidKeyException::builder() + ->withContext([ + 'key' => $key + ]) + ->build(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage::iterate() To retrieve an iterable of the elements in the + * storage. + */ + public function getIterator ():Traversable { + + yield from $this->storage->iterate(); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/structure/firehub.Vector.php b/src/support/datastructure/structure/firehub.Vector.php new file mode 100644 index 00000000..09a6df6c --- /dev/null +++ b/src/support/datastructure/structure/firehub.Vector.php @@ -0,0 +1,628 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.1 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Structure; + +use FireHub\Core\Support\Contracts\DataStructure; +use FireHub\Core\Support\DataStructure\Structure\Snapshot\VectorSnapshot; +use FireHub\Core\Support\DataStructure\Abstraction\Collection; +use FireHub\Core\Support\DataStructure\Type\Linear; +use FireHub\Core\Support\DataStructure\Capability\ { + Copyable, Countable, Forkable, Freezable, Rebuildable, Rehydratable, Snapshotable +}; +use FireHub\Core\Support\DataStructure\Runtime\ { + HasCopyOnWriteState, HasFreezeState, StructureState +}; +use FireHub\Core\Support\DataStructure\DTO\ { + DehydratedState, StateHeader +}; +use FireHub\Core\Support\DataStructure\Storage; +use FireHub\Core\Support\DataStructure\Storage\Capability\ { + Cloneable, DequeMutation, IndexAccess, IndexMutation, LinearBoundaryAccess, StorageMetricsAware +}; +use FireHub\Core\Shared\Type\Maybe; +use FireHub\Core\Shared\Enums\MutationOutcome; +use FireHub\Core\Throwable\Exception\Support\DataStructure\ { + InvalidDataStructureException, InvalidKeyException, InvalidStorageException +}; +use FireHub\Core\Support\LowLevel\ClsObj; +use Traversable; + +/** + * ### Vector — Indexed Linear Data Structure + * + * A dynamic, index-based linear data structure that provides constant-time random access and efficient positional + * operations. Vector is designed for scenarios where elements are stored in a contiguous logical sequence and accessed + * via integer indices. It supports operations such as retrieval, update, insertion, and removal by index, while + * abstracting the underlying storage implementation (array-based, fixed-capacity, or optimized storage backends). + * Vector prioritizes fast access and predictable indexing behavior, making it suitable for computation-heavy and + * lookup-oriented use cases. + * @since 1.0.0 + * + * @template TValue + * + * @implements \FireHub\Core\Support\Contracts\DataStructure + * @implements \FireHub\Core\Support\DataStructure\Abstraction\Collection + * @implements \FireHub\Core\Support\DataStructure\Type\Linear + * @implements \FireHub\Core\Support\DataStructure\Capability\Snapshotable + * @implements \FireHub\Core\Support\DataStructure\Capability\Rehydratable, StorageType, array{values: array}> + * @implements \FireHub\Core\Support\DataStructure\Capability\Rebuildable + * + * @phpstan-type StorageType = (Storage&Cloneable&StorageMetricsAware&LinearBoundaryAccess&DequeMutation&IndexAccess&IndexMutation) + */ +final class Vector implements DataStructure, Collection, Linear, Copyable, Forkable, Snapshotable, Freezable, + Rehydratable, Rebuildable, Countable { + + /** + * ### Copy-On-Write State Management + * @since 1.0.0 + */ + use HasCopyOnWriteState; + + /** + * ### Mutation Freeze Control + * @since 1.0.0 + */ + use HasFreezeState; + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage As parameter. + * + * @param StorageType $storage

+ * The storage backend for the data structure. + *

+ * + * @return void + */ + public function __construct ( + protected Storage&Cloneable&StorageMetricsAware&LinearBoundaryAccess&DequeMutation&IndexAccess&IndexMutation $storage + ) { + + $this->state = new StructureState(); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function copy ():static { + + $copy = new self($this->storage->copy()); + + $copy->frozen = $this->frozen; + + return $copy; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::increaseRef() To increse shared + * ownership reference. + */ + public function fork ():static { + + $this->increaseRef(); + + return clone $this; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @return \FireHub\Core\Support\DataStructure\Structure\Snapshot\VectorSnapshot Immutable snapshot of + * current state. + */ + public function snapshot ():VectorSnapshot { + + $copy = new self($this->storage->copy()); + + $copy->frozen = true; + + return new VectorSnapshot($copy); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + */ + public function freeze ():void { + + $this->detachIfNeeded(); + + $this->frozen = true; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + public function dehydrate ():DehydratedState { + + $values = []; + + foreach ($this as $value) + $values[] = $value; + + /** @var DehydratedState, StorageType, array{values: array}> */ + return new DehydratedState( + new StateHeader(1, self::class, $this->storage::class), + ['values' => $values] + ); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\BackInsertion::addLast() To add the last element + * to the storage. + * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidDataStructureException If the data + * structure is not of the expected type. + */ + public static function hydrate (DehydratedState $state):static { + + if ($state->header->structure !== self::class) + throw new InvalidDataStructureException; + + $storage = new $state->header->storage(); + + $storage->addLast(...$state->payload['values']); + + return new self($storage); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\ClsObj::ofClass() To check if storage has Convertible interface. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\Convertible::fromStorage() To create a new + * instance of the storage. + * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidStorageException If the storage is not + * convertible. + */ + public function rebuild (string $storage):static { + + $new_storage = ClsObj::ofClass($storage, Storage\Capability\Convertible::class) + ? $storage::fromStorage($this->storage) + : throw InvalidStorageException::builder() + ->withContext( + ['storage' => $storage] + ) + ->build(); + + return new self($new_storage); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\StorageMetricsAware::size() To retrieve the number + * of elements in the storage. + */ + public function count ():int { + + return $this->storage->size(); + + } + + /** + * ### Retrieve the first element + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\LinearBoundaryAccess::first() To retrieve the first + * element from the storage. + * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with first element + * of the structure, or Maybe with null if structure is empty. + */ + public function first ():Maybe { + + return $this->storage->first(); + + } + + /** + * ### Retrieve the last element + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\LinearBoundaryAccess::last() To retrieve the last + * element from the storage. + * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with last element + * of the structure, or Maybe with null if structure is empty. + */ + public function last ():Maybe { + + return $this->storage->last(); + + } + + /** + * ### Check Index Existence + * + * Determines whether a valid element exists at the given positional index. This operation does not retrieve the + * value and is optimized for fast boundary or presence checks within indexed structures. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\IndexAccess::has() To check if index exists. + * + * @param int $index

+ * The key to check for existence. + *

+ * + * @return bool True if the key exists, false otherwise. + */ + public function has (int $index):bool { + + return $this->storage->has($index); + + } + + /** + * ### Retrieve Value by Index + * + * Returns the value located at the specified positional index within the structure. If the index does not exist or + * is out of bounds, an empty Maybe is returned. This operation provides safe, read-only access to ordered structure + * without exposing internal structure or requiring direct array access. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Type\Maybe As return. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\IndexAccess::get() Get Value by Index from storage. + * + * @param int $index

+ * The key to retrieve value by index. + *

+ * + * @return \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe Maybe with element at index + * position of the structure, or Maybe with null if element at index position of the storage doesn't exist. + */ + public function get (int $index):Maybe { + + return $this->storage->get($index); + + } + + /** + * ### Set Value at Index + * + * Assigns a value to the specified positional index in the structure. If the index already contains a value, it is + * overwritten according to the structure’s mutation semantics. This operation assumes a valid index-based + * addressing model and does not perform key resolution or structural lookup. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\IndexMutation::set() To set Value at Index to + * storage. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param int $index

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the index. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::CREATED|\FireHub\Core\Shared\Enums\MutationOutcome::UPDATED + * An enum indicating the result of the mutation operation. + */ + public function set (int $index, mixed $value):MutationOutcome { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + return $this->storage->set($index, $value); + + } + + /** + * ### Set Value at Index if exists + * + * Assigns a value to the specified positional index in the structure. If the index already contains a value, it is + * overwritten according to the structure’s mutation semantics. This operation assumes a valid index-based + * addressing model and does not perform key resolution or structural lookup. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector::has() To check if index exists. + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector::set() To set Value at Index. + * + * @param int $index

+ * The key where the value will be added. + *

+ * @param TValue $value

+ * Value to add to the index. + *

+ * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException If the value does not exist. + * + * @return void + */ + public function replace (int $index, mixed $value):void { + + $this->has($index) + ? $this->set($index, $value) + : throw InvalidKeyException::builder() + ->withContext([ + 'index' => $index + ]) + ->build(); + + } + + /** + * ### Remove Value by Index + * + * Removes the element located at the specified index. The behavior after removal depends on the structure + * implementation (e.g., shifting in lists, pulling in fixed structure, or logical repositioning in ring buffers). + * This operation affects structural layout but not value semantics directly. + * @since 1.0.0 + * + * @uses \FireHub\Core\Shared\Enums\MutationOutcome As return. + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\IndexMutation::remove() To remove Value at Index to + * storage. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param int $index

+ * The key of the value to remove. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return \FireHub\Core\Shared\Enums\MutationOutcome::REMOVED|\FireHub\Core\Shared\Enums\MutationOutcome::NOT_FOUND + * An enum indicating the result of the mutation operation. + */ + public function remove (int $index):MutationOutcome { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + return $this->storage->remove($index); + + } + + /** + * ### Remove Value by Index if exists + * + * Removes the element located at the specified index. The behavior after removal depends on the structure + * implementation (e.g., shifting in lists, pulling in fixed structure, or logical repositioning in ring buffers). + * This operation affects structural layout but not value semantics directly. + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector::has() To check if index exists. + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector::remove() To remove Value at Index. + * + * @param int $index

+ * The key of the value to remove. + *

+ * + * @throws \FireHub\Core\Shared\Contracts\Throwable + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidKeyException If the value does not exist. + * + * @return void + */ + public function delete (int $index):void { + + $this->has($index) + ? $this->remove($index) + : throw InvalidKeyException::builder() + ->withContext([ + 'index' => $index + ]) + ->build(); + + } + + /** + * ### Prepend values to the front + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\FrontInsertion::addFirst() To prepend values to + * the front of the storage. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param TValue ...$values

+ * List of values to add to the front of the structure. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return static The modified structure. + */ + public function prepend (mixed ...$values):static { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + $this->storage->addFirst(...$values); + + return $this; + + } + + /** + * ### Append values to the back + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\BackInsertion::addLast() To append values to + * the back of the storage. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param TValue ...$values

+ * List of values to add to the back of the structure. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return static The modified structure. + */ + public function append (mixed ...$values):static { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + $this->storage->addLast(...$values); + + return $this; + + } + + /** + * ### Removes values from the front + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\FrontRemoval::removeFirst() To remove values from + * the front of the storage. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param int $items [optional]

+ * Number of values to remove from the front of the structure. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return static The modified structure. + */ + public function shift (int $items = 1):static { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + $this->storage->removeFirst($items); + + return $this; + + } + + /** + * ### Removes values from the back + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage\Capability\BackRemoval::removeLast() To remove values from + * the back of the storage. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasFreezeState::assertNotFrozen() To check if structure is + * frozen. + * @uses \FireHub\Core\Support\DataStructure\Runtime\HasCopyOnWriteState::detachIfNeeded() To performe a + * copy-on-write operation if the current storage is shared between multiple data structure instances. + * + * @param int $items [optional]

+ * Number of values to remove from the back of the structure. + *

+ * + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\FrozenDataStructureException If the structure is + * frozen. + * @throws \FireHub\Core\Throwable\Exception\Support\DataStructure\InvalidCowStateException If the reference counter + * drops bellow 1. + * + * @return static The modified structure. + */ + public function pop (int $items = 1):static { + + $this->assertNotFrozen(); + $this->detachIfNeeded(); + + $this->storage->removeLast($items); + + return $this; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Storage::iterate() To retrieve an iterable of the elements in the + * storage. + */ + public function getIterator ():Traversable { + + yield from $this->storage->iterate(); + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/structure/snapshot/firehub.MapSnapshot.php b/src/support/datastructure/structure/snapshot/firehub.MapSnapshot.php new file mode 100644 index 00000000..4e3b8af7 --- /dev/null +++ b/src/support/datastructure/structure/snapshot/firehub.MapSnapshot.php @@ -0,0 +1,79 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Structure\Snapshot; + +use FireHub\Core\Support\DataStructure\Structure\Map; +use Traversable; + +/** + * ### Map Snapshot + * @since 1.0.0 + * + * @template TKey of array-key + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot + * + * @method int count() Element Count Retrieval + * @method Traversable iterate() Retrieve an external iterator + * @method bool has (int|string $key) Check Key Existence + * @method \FireHub\Core\Shared\Type\Maybe get (int|string $key) Retrieve Value by Key + */ +final readonly class MapSnapshot extends Snapshot { + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector As parameter. + * + * @param \FireHub\Core\Support\DataStructure\Structure\Map $structure

+ * The map to be encapsulated by the snapshot. + *

+ * + * @return void + */ + public function __construct( + Map $structure + ) { + + parent::__construct($structure); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + protected function allowedMethods ():array { + + return ['count', 'getIterator', 'has', 'get']; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + protected function methodAliases ():array { + + return [ + 'iterate' => 'getIterator' + ]; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/structure/snapshot/firehub.Snapshot.php b/src/support/datastructure/structure/snapshot/firehub.Snapshot.php new file mode 100644 index 00000000..78e307e9 --- /dev/null +++ b/src/support/datastructure/structure/snapshot/firehub.Snapshot.php @@ -0,0 +1,104 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Structure\Snapshot; + +use FireHub\Core\Support\Contracts\DataStructure; +use FireHub\Core\Support\LowLevel\Arr; +use LogicException; + +/** + * ### Abstract Snapshot — Read-Only Data Structure Projection Base + * + * Provides a base implementation for creating immutable, read-only projections of data structures. It acts as a + * controlled delegation layer over an underlying data structure instance, exposing only permitted read operations + * while blocking all mutation capabilities. Designed to standardize snapshot behavior across all FireHub data + * structures, ensuring consistent immutability semantics and controlled API exposure. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +abstract readonly class Snapshot { + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\Contracts\DataStructure As parameter. + * + * @param \FireHub\Core\Support\Contracts\DataStructure $structure

+ * The data structure to be encapsulated by the snapshot. + *

+ * + * @return void + */ + public function __construct( + protected DataStructure $structure + ) {} + + /** + * ### List of allowed snapshot methods + * @since 1.0.0 + * + * @return list + */ + abstract protected function allowedMethods ():array; + + /** + * ### List of method aliases + * @since 1.0.0 + * + * @return array + */ + protected function methodAliases ():array { + + return []; + + } + + /** + * ### Invoking inaccessible methods on snapshot + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\LowLevel\Arr::inArray() To check if method is allowed. + * @uses \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot::methodAliases() To get method alias if + * exists. + * @uses \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot::allowedMethods() To check if method name + * in allowed list. + * + * @param string $name

+ * Method name. + *

+ * @param array $arguments>

+ * Method arguments. + *

+ * + * @throws \LogicException If method is not allowed. + * + * @return mixed Method return value. + */ + final public function __call (string $name, array $arguments):mixed { + + $method = $this->methodAliases()[$name] ?? $name; + + if (!Arr::inArray($this->allowedMethods(), $method)) + throw new LogicException( + "Method $name is not allowed on snapshot." + ); + + return $this->structure->$method(...$arguments); // @phpstan-ignore method.dynamicName + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/structure/snapshot/firehub.VectorSnapshot.php b/src/support/datastructure/structure/snapshot/firehub.VectorSnapshot.php new file mode 100644 index 00000000..b8cac18d --- /dev/null +++ b/src/support/datastructure/structure/snapshot/firehub.VectorSnapshot.php @@ -0,0 +1,82 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.2 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Structure\Snapshot; + +use FireHub\Core\Support\DataStructure\Structure\Vector; +use Traversable; + +/** + * ### Vector Snapshot + * @since 1.0.0 + * + * @template TValue + * + * @extends \FireHub\Core\Support\DataStructure\Structure\Snapshot\Snapshot + * + * @method int count() Element Count Retrieval + * @method Traversable iterate() Retrieve an external iterator + * @method \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe last () Retrieve the first + * element + * @method \FireHub\Core\Shared\Type\Maybe|\FireHub\Core\Shared\Type\Maybe first () Retrieve the last + * element + * @method bool has (int $index) Check Index Existence + * @method \FireHub\Core\Shared\Type\Maybe get (int $index) Retrieve Value by Index + */ +final readonly class VectorSnapshot extends Snapshot { + + /** + * ### Constructor + * @since 1.0.0 + * + * @uses \FireHub\Core\Support\DataStructure\Structure\Vector As parameter. + * + * @param \FireHub\Core\Support\DataStructure\Structure\Vector $structure

+ * The vector to be encapsulated by the snapshot. + *

+ * + * @return void + */ + public function __construct( + Vector $structure + ) { + + parent::__construct($structure); + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + protected function allowedMethods ():array { + + return ['count', 'getIterator', 'first', 'last', 'has', 'get']; + + } + + /** + * @inheritDoc + * + * @since 1.0.0 + */ + protected function methodAliases ():array { + + return [ + 'iterate' => 'getIterator' + ]; + + } + +} \ No newline at end of file diff --git a/src/support/datastructure/type/firehub.Associative.php b/src/support/datastructure/type/firehub.Associative.php new file mode 100644 index 00000000..ec4c04b2 --- /dev/null +++ b/src/support/datastructure/type/firehub.Associative.php @@ -0,0 +1,29 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Type; + +/** + * ### Associative Data Structure Type + * + * Represents a key-addressable data structure where values are associated with explicit logical keys instead of + * positional indexes. + * + * Associative structures provide deterministic key-to-value relationships and are optimized for semantic lookup, + * mapping, and keyed access operations rather than sequential traversal semantics. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface Associative {} \ No newline at end of file diff --git a/src/support/datastructure/type/firehub.Linear.php b/src/support/datastructure/type/firehub.Linear.php new file mode 100644 index 00000000..3b81ce00 --- /dev/null +++ b/src/support/datastructure/type/firehub.Linear.php @@ -0,0 +1,28 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 7.0 + * @package Core\Support + */ + +namespace FireHub\Core\Support\DataStructure\Type; + +/** + * ### Linear Data Structure Type + * + * Represents a data topology where elements are organized in a sequential, ordered manner, forming a single logical + * line of accessibility. Linear type structures define adjacency-based relationships between elements (previous/next) + * and serve as the foundation for sequential data models such as stacks, queues, deque, and vectors, independent of + * heir storage or abstraction layer. + * @since 1.0.0 + * + * @template TKey + * @template TValue + */ +interface Linear {} \ No newline at end of file diff --git a/src/support/firehub.Autoload.php b/src/support/firehub.Autoload.php index 8c27aaf5..fee8fa9a 100644 --- a/src/support/firehub.Autoload.php +++ b/src/support/firehub.Autoload.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support; diff --git a/src/support/firehub.LowLevel.php b/src/support/firehub.LowLevel.php index f7c59cdc..f6883c5c 100644 --- a/src/support/firehub.LowLevel.php +++ b/src/support/firehub.LowLevel.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support; diff --git a/src/support/lowlevel/firehub.Arr.php b/src/support/lowlevel/firehub.Arr.php index 7cfeec7e..520e859f 100644 --- a/src/support/lowlevel/firehub.Arr.php +++ b/src/support/lowlevel/firehub.Arr.php @@ -9,8 +9,6 @@ * * @php-version 8.5 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; @@ -176,23 +174,19 @@ public static function any (array $array, callable $callback):bool { * Key can be any value possible for an array index. * @since 1.0.0 * - * @template TKey of array-key - * - * @param TKey $key

+ * @param array-key $key

* Key to check. *

* @param array $array

* An array with keys to check. *

* - * @phpstan-assert-if-true array $array - * * @return bool True if the key exists in an array, false otherwise. * * @note Method will search for the keys in the first dimension only. * Nested keys in multidimensional arrays will not be found. */ - public static function keyExist (int|string $key, array $array):bool { + public static function keyExists (int|string $key, array $array):bool { return array_key_exists($key, $array); @@ -1472,8 +1466,7 @@ public static function reverse (array $array, bool $preserve_keys = false):array * You can change this behavior by setting preserve_keys to true. *

* - * @return ( - * $preserve_keys is true + * @return ( $preserve_keys is true * ? array * : ($array is list * ? list @@ -1563,28 +1556,51 @@ public static function unique (array $array, Compare $compare = Compare::AS_REGU * ### Create an array containing a range of elements * @since 1.0.0 * - * @param int|float|string $start

+ * @uses \FireHub\Core\Support\LowLevel\DataIs::string() To determine if the $start and $end values are strings. + * + * @template TStart of int|float|string + * @template TEnd of int|float|string + * @template TStep of int|float + * + * @param TStart $start

* First value of the sequence. *

- * @param int|float|string $end

+ * @param TEnd $end

* The sequence is ended upon reaching the end value. *

- * @param positive-int|float $step [optional]

+ * @param TStep $step [optional]

* If a step value is given, it will be used as the increment between elements in the sequence.
* Step should be given as a positive number. If not specified, a step will default to 1. *

* * @throws \FireHub\Core\Throwable\Error\LowLevel\Arr\OutOfRangeError If $step is 0, $start, $end, or $step is not - * finite, or $step is negative, but the produced range is increasing (in other words, $start <= $end). - * - * @return list Sequence of elements as an array with the first element being start going up to - * end, with each value of the sequence being step values apart. + * finite, or $step is negative, but the produced range is increasing (in other words, $start <= $end), or if one + * is string, but not both. + * + * @return (TStart is string + * ? array + * : (TEnd is string + * ? array + * : (TStart is float + * ? array + * : (TEnd is float + * ? array + * : (TStep is float + * ? array + * : array)))) + * ) Sequence of elements as an array with the first element being start going up to end, with each value of the + * sequence being step values apart. * * @note Character sequence values are limited to a length of one.
* If a length greater than one is entered only the first character is used. */ public static function range (int|float|string $start, int|float|string $end, int|float $step = 1):array { + if (DataIs::string($start) xor DataIs::string($end)) + throw new OutOfRangeError( + 'Start and end must be of the same type. If one is string, both must be string.' + ); + try { return range($start, $end, $step); diff --git a/src/support/lowlevel/firehub.CharMB.php b/src/support/lowlevel/firehub.CharMB.php index c80eafd3..e95bfebf 100644 --- a/src/support/lowlevel/firehub.CharMB.php +++ b/src/support/lowlevel/firehub.CharMB.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.CharSB.php b/src/support/lowlevel/firehub.CharSB.php index cd5a03ca..093b0f61 100644 --- a/src/support/lowlevel/firehub.CharSB.php +++ b/src/support/lowlevel/firehub.CharSB.php @@ -9,8 +9,6 @@ * * @php-version 8.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.ClsObj.php b/src/support/lowlevel/firehub.ClsObj.php index e72cf70b..4c8a675b 100644 --- a/src/support/lowlevel/firehub.ClsObj.php +++ b/src/support/lowlevel/firehub.ClsObj.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Constant.php b/src/support/lowlevel/firehub.Constant.php index b86edd10..aa0e87c1 100644 --- a/src/support/lowlevel/firehub.Constant.php +++ b/src/support/lowlevel/firehub.Constant.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Data.php b/src/support/lowlevel/firehub.Data.php index d9d08cb3..4f5db9c0 100644 --- a/src/support/lowlevel/firehub.Data.php +++ b/src/support/lowlevel/firehub.Data.php @@ -9,8 +9,6 @@ * * @php-version 8.4 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; @@ -239,7 +237,7 @@ public static function unserialize (string $data, bool|array $allowed_classes = return ($unserialized_data = unserialize( $data, - ['allowed_classes' => $allowed_classes, 'max_depth' => $max_depth]) + ['allowed_classes' => $allowed_classes, 'max_depth' => $max_depth]) // @phpstan-ignore argument.type ) !== false ? $unserialized_data : throw new UnserializeFailedError; diff --git a/src/support/lowlevel/firehub.DataIs.php b/src/support/lowlevel/firehub.DataIs.php index 8a2b9343..5ccebfe0 100644 --- a/src/support/lowlevel/firehub.DataIs.php +++ b/src/support/lowlevel/firehub.DataIs.php @@ -9,8 +9,6 @@ * * @php-version 7.3 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.DateAndTime.php b/src/support/lowlevel/firehub.DateAndTime.php index 6f9760e9..b6b7748d 100644 --- a/src/support/lowlevel/firehub.DateAndTime.php +++ b/src/support/lowlevel/firehub.DateAndTime.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Declared.php b/src/support/lowlevel/firehub.Declared.php index f94e5db2..37d73e02 100644 --- a/src/support/lowlevel/firehub.Declared.php +++ b/src/support/lowlevel/firehub.Declared.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.FileSystem.php b/src/support/lowlevel/firehub.FileSystem.php index 56225553..818f116d 100644 --- a/src/support/lowlevel/firehub.FileSystem.php +++ b/src/support/lowlevel/firehub.FileSystem.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Func.php b/src/support/lowlevel/firehub.Func.php index 526cd2be..66352a84 100644 --- a/src/support/lowlevel/firehub.Func.php +++ b/src/support/lowlevel/firehub.Func.php @@ -9,8 +9,6 @@ * * @php-version 8.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Iterator.php b/src/support/lowlevel/firehub.Iterator.php index d81c070a..e9e24f37 100644 --- a/src/support/lowlevel/firehub.Iterator.php +++ b/src/support/lowlevel/firehub.Iterator.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Json.php b/src/support/lowlevel/firehub.Json.php index 5a1001db..5ac607df 100644 --- a/src/support/lowlevel/firehub.Json.php +++ b/src/support/lowlevel/firehub.Json.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Math.php b/src/support/lowlevel/firehub.Math.php index 56efd423..438bad3b 100644 --- a/src/support/lowlevel/firehub.Math.php +++ b/src/support/lowlevel/firehub.Math.php @@ -9,8 +9,6 @@ * * @php-version 8.4 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Random.php b/src/support/lowlevel/firehub.Random.php index 21803e86..4bf9336e 100644 --- a/src/support/lowlevel/firehub.Random.php +++ b/src/support/lowlevel/firehub.Random.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Regex.php b/src/support/lowlevel/firehub.Regex.php index e2c5ee56..0d8a6500 100644 --- a/src/support/lowlevel/firehub.Regex.php +++ b/src/support/lowlevel/firehub.Regex.php @@ -9,8 +9,6 @@ * * @php-version 8.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.RegexMB.php b/src/support/lowlevel/firehub.RegexMB.php index b125eff4..d2cff8f4 100644 --- a/src/support/lowlevel/firehub.RegexMB.php +++ b/src/support/lowlevel/firehub.RegexMB.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.Resources.php b/src/support/lowlevel/firehub.Resources.php index 30e0684c..dc587f92 100644 --- a/src/support/lowlevel/firehub.Resources.php +++ b/src/support/lowlevel/firehub.Resources.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.SplAutoload.php b/src/support/lowlevel/firehub.SplAutoload.php index b7850bf1..84aa744c 100644 --- a/src/support/lowlevel/firehub.SplAutoload.php +++ b/src/support/lowlevel/firehub.SplAutoload.php @@ -9,8 +9,6 @@ * * @php-version 8.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.StrMB.php b/src/support/lowlevel/firehub.StrMB.php index 228d6249..e4c87ae4 100644 --- a/src/support/lowlevel/firehub.StrMB.php +++ b/src/support/lowlevel/firehub.StrMB.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/support/lowlevel/firehub.StrSB.php b/src/support/lowlevel/firehub.StrSB.php index a75c0ab8..dab01d87 100644 --- a/src/support/lowlevel/firehub.StrSB.php +++ b/src/support/lowlevel/firehub.StrSB.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; @@ -31,6 +29,7 @@ use function addcslashes; use function chunk_split; use function count_chars; +use function crc32; use function explode; use function implode; use function lcfirst; @@ -1238,4 +1237,20 @@ public static function format (string $format, null|bool|float|int|string ...$va } + /** + * ### Calculates the crc32 polynomial of a string + * @since 1.0.0 + * + * @param string $string

+ * The data. + *

+ * + * @return int crc32 checksum of string as an integer. + */ + public static function crc32 (string $string):int { + + return crc32($string); + + } + } \ No newline at end of file diff --git a/src/support/lowlevel/firehub.SystemRuntime.php b/src/support/lowlevel/firehub.SystemRuntime.php index 7a834881..a2205403 100644 --- a/src/support/lowlevel/firehub.SystemRuntime.php +++ b/src/support/lowlevel/firehub.SystemRuntime.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Support\LowLevel; diff --git a/src/testing/firehub.Base.php b/src/testing/firehub.Base.php index 0f119c6a..b9d45e08 100644 --- a/src/testing/firehub.Base.php +++ b/src/testing/firehub.Base.php @@ -9,8 +9,6 @@ * * @php-version 7.0 * @package Core\Support - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Testing; diff --git a/src/throwable/error/lowlevel/arr/firehub.ChunkLengthTooSmallError.php b/src/throwable/error/lowlevel/arr/firehub.ChunkLengthTooSmallError.php index 74ec0802..02cd1efc 100644 --- a/src/throwable/error/lowlevel/arr/firehub.ChunkLengthTooSmallError.php +++ b/src/throwable/error/lowlevel/arr/firehub.ChunkLengthTooSmallError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/arr/firehub.FailedToSortMultiArrayError.php b/src/throwable/error/lowlevel/arr/firehub.FailedToSortMultiArrayError.php index 06fda275..67bef598 100644 --- a/src/throwable/error/lowlevel/arr/firehub.FailedToSortMultiArrayError.php +++ b/src/throwable/error/lowlevel/arr/firehub.FailedToSortMultiArrayError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/arr/firehub.KeysAndValuesDiffNumberOfElemsError.php b/src/throwable/error/lowlevel/arr/firehub.KeysAndValuesDiffNumberOfElemsError.php index 78ebf2f7..9af7c3e8 100644 --- a/src/throwable/error/lowlevel/arr/firehub.KeysAndValuesDiffNumberOfElemsError.php +++ b/src/throwable/error/lowlevel/arr/firehub.KeysAndValuesDiffNumberOfElemsError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/arr/firehub.OutOfRangeError.php b/src/throwable/error/lowlevel/arr/firehub.OutOfRangeError.php index 31eb8849..68f532fe 100644 --- a/src/throwable/error/lowlevel/arr/firehub.OutOfRangeError.php +++ b/src/throwable/error/lowlevel/arr/firehub.OutOfRangeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/arr/firehub.SizeInconsistentError.php b/src/throwable/error/lowlevel/arr/firehub.SizeInconsistentError.php index edb75968..36288a08 100644 --- a/src/throwable/error/lowlevel/arr/firehub.SizeInconsistentError.php +++ b/src/throwable/error/lowlevel/arr/firehub.SizeInconsistentError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/autoload/firehub.RegisterAutoloadError.php b/src/throwable/error/lowlevel/autoload/firehub.RegisterAutoloadError.php index b920d5d9..a9b64fd1 100644 --- a/src/throwable/error/lowlevel/autoload/firehub.RegisterAutoloadError.php +++ b/src/throwable/error/lowlevel/autoload/firehub.RegisterAutoloadError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/autoload/firehub.UnregisterAutoloaderError.php b/src/throwable/error/lowlevel/autoload/firehub.UnregisterAutoloaderError.php index c07153ca..b9eae03d 100644 --- a/src/throwable/error/lowlevel/autoload/firehub.UnregisterAutoloaderError.php +++ b/src/throwable/error/lowlevel/autoload/firehub.UnregisterAutoloaderError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Arr; diff --git a/src/throwable/error/lowlevel/clsobj/firehub.ClassDoesntExistError.php b/src/throwable/error/lowlevel/clsobj/firehub.ClassDoesntExistError.php index 313bf69a..1038f096 100644 --- a/src/throwable/error/lowlevel/clsobj/firehub.ClassDoesntExistError.php +++ b/src/throwable/error/lowlevel/clsobj/firehub.ClassDoesntExistError.php @@ -11,8 +11,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\ClsObj; diff --git a/src/throwable/error/lowlevel/clsobj/firehub.FailedToCreateAliasError.php b/src/throwable/error/lowlevel/clsobj/firehub.FailedToCreateAliasError.php index 09718607..d2d75a56 100644 --- a/src/throwable/error/lowlevel/clsobj/firehub.FailedToCreateAliasError.php +++ b/src/throwable/error/lowlevel/clsobj/firehub.FailedToCreateAliasError.php @@ -11,8 +11,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\ClsObj; diff --git a/src/throwable/error/lowlevel/constant/firehub.AlreadyExistError.php b/src/throwable/error/lowlevel/constant/firehub.AlreadyExistError.php index d3aa17ec..282e48b6 100644 --- a/src/throwable/error/lowlevel/constant/firehub.AlreadyExistError.php +++ b/src/throwable/error/lowlevel/constant/firehub.AlreadyExistError.php @@ -11,8 +11,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Constant; diff --git a/src/throwable/error/lowlevel/constant/firehub.FailedToDefineError.php b/src/throwable/error/lowlevel/constant/firehub.FailedToDefineError.php index d4128756..7f9461d5 100644 --- a/src/throwable/error/lowlevel/constant/firehub.FailedToDefineError.php +++ b/src/throwable/error/lowlevel/constant/firehub.FailedToDefineError.php @@ -11,8 +11,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Constant; diff --git a/src/throwable/error/lowlevel/constant/firehub.NotDefinedError.php b/src/throwable/error/lowlevel/constant/firehub.NotDefinedError.php index a705ab4d..b36b3428 100644 --- a/src/throwable/error/lowlevel/constant/firehub.NotDefinedError.php +++ b/src/throwable/error/lowlevel/constant/firehub.NotDefinedError.php @@ -11,8 +11,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Constant; diff --git a/src/throwable/error/lowlevel/data/firehub.ArrayToStringConversionError.php b/src/throwable/error/lowlevel/data/firehub.ArrayToStringConversionError.php index 15fead3a..a7e826f3 100644 --- a/src/throwable/error/lowlevel/data/firehub.ArrayToStringConversionError.php +++ b/src/throwable/error/lowlevel/data/firehub.ArrayToStringConversionError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Data; diff --git a/src/throwable/error/lowlevel/data/firehub.CannotSerializeError.php b/src/throwable/error/lowlevel/data/firehub.CannotSerializeError.php index 0bc69ef1..de2d7c58 100644 --- a/src/throwable/error/lowlevel/data/firehub.CannotSerializeError.php +++ b/src/throwable/error/lowlevel/data/firehub.CannotSerializeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Data; diff --git a/src/throwable/error/lowlevel/data/firehub.FailedToSetTypeError.php b/src/throwable/error/lowlevel/data/firehub.FailedToSetTypeError.php index 841444ee..fdcdbff9 100644 --- a/src/throwable/error/lowlevel/data/firehub.FailedToSetTypeError.php +++ b/src/throwable/error/lowlevel/data/firehub.FailedToSetTypeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Data; diff --git a/src/throwable/error/lowlevel/data/firehub.SetAsResourceError.php b/src/throwable/error/lowlevel/data/firehub.SetAsResourceError.php index 258a8796..14a057c3 100644 --- a/src/throwable/error/lowlevel/data/firehub.SetAsResourceError.php +++ b/src/throwable/error/lowlevel/data/firehub.SetAsResourceError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Data; diff --git a/src/throwable/error/lowlevel/data/firehub.TypeUnknownError.php b/src/throwable/error/lowlevel/data/firehub.TypeUnknownError.php index 17851b22..1f6940e9 100644 --- a/src/throwable/error/lowlevel/data/firehub.TypeUnknownError.php +++ b/src/throwable/error/lowlevel/data/firehub.TypeUnknownError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Data; diff --git a/src/throwable/error/lowlevel/data/firehub.UnserializeFailedError.php b/src/throwable/error/lowlevel/data/firehub.UnserializeFailedError.php index 1d033888..73dead3b 100644 --- a/src/throwable/error/lowlevel/data/firehub.UnserializeFailedError.php +++ b/src/throwable/error/lowlevel/data/firehub.UnserializeFailedError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Data; diff --git a/src/throwable/error/lowlevel/datetime/firehub.FailedToFormatTimestampAsIntError.php b/src/throwable/error/lowlevel/datetime/firehub.FailedToFormatTimestampAsIntError.php index 9baf8fc1..2cef5bd4 100644 --- a/src/throwable/error/lowlevel/datetime/firehub.FailedToFormatTimestampAsIntError.php +++ b/src/throwable/error/lowlevel/datetime/firehub.FailedToFormatTimestampAsIntError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\DateTime; diff --git a/src/throwable/error/lowlevel/datetime/firehub.FailedToGetZoneError.php b/src/throwable/error/lowlevel/datetime/firehub.FailedToGetZoneError.php index 5fb9a998..4e3e9af8 100644 --- a/src/throwable/error/lowlevel/datetime/firehub.FailedToGetZoneError.php +++ b/src/throwable/error/lowlevel/datetime/firehub.FailedToGetZoneError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\DateTime; diff --git a/src/throwable/error/lowlevel/datetime/firehub.FailedToSetZoneError.php b/src/throwable/error/lowlevel/datetime/firehub.FailedToSetZoneError.php index e2202f65..ba506639 100644 --- a/src/throwable/error/lowlevel/datetime/firehub.FailedToSetZoneError.php +++ b/src/throwable/error/lowlevel/datetime/firehub.FailedToSetZoneError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\DateTime; diff --git a/src/throwable/error/lowlevel/datetime/firehub.FormatTimestampError.php b/src/throwable/error/lowlevel/datetime/firehub.FormatTimestampError.php index 55504a4f..a89ea2d3 100644 --- a/src/throwable/error/lowlevel/datetime/firehub.FormatTimestampError.php +++ b/src/throwable/error/lowlevel/datetime/firehub.FormatTimestampError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\DateTime; diff --git a/src/throwable/error/lowlevel/datetime/firehub.ParseFromFormatError.php b/src/throwable/error/lowlevel/datetime/firehub.ParseFromFormatError.php index b0055b34..3c845876 100644 --- a/src/throwable/error/lowlevel/datetime/firehub.ParseFromFormatError.php +++ b/src/throwable/error/lowlevel/datetime/firehub.ParseFromFormatError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\DateTime; diff --git a/src/throwable/error/lowlevel/datetime/firehub.StringToTimestampError.php b/src/throwable/error/lowlevel/datetime/firehub.StringToTimestampError.php index bcf650da..b2039962 100644 --- a/src/throwable/error/lowlevel/datetime/firehub.StringToTimestampError.php +++ b/src/throwable/error/lowlevel/datetime/firehub.StringToTimestampError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\DateTime; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.CannotListError.php b/src/throwable/error/lowlevel/filesystem/firehub.CannotListError.php index bf17d5f9..8f5571dd 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.CannotListError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.CannotListError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkGroupError.php b/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkGroupError.php index 14ac14f0..1366c1aa 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkGroupError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkGroupError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkOwnerError.php b/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkOwnerError.php index bec9bbc9..7633d4da 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkOwnerError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.ChangeSymlinkOwnerError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.CopyPathError.php b/src/throwable/error/lowlevel/filesystem/firehub.CopyPathError.php index ad5466c2..c7931754 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.CopyPathError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.CopyPathError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.CreateFolderError.php b/src/throwable/error/lowlevel/filesystem/firehub.CreateFolderError.php index 923baf11..8ffd5211 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.CreateFolderError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.CreateFolderError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.CreateLinkError.php b/src/throwable/error/lowlevel/filesystem/firehub.CreateLinkError.php index ad67d196..1809baec 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.CreateLinkError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.CreateLinkError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.CreateSymlinkError.php b/src/throwable/error/lowlevel/filesystem/firehub.CreateSymlinkError.php index 5f113844..686c722a 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.CreateSymlinkError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.CreateSymlinkError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.DeletePathError.php b/src/throwable/error/lowlevel/filesystem/firehub.DeletePathError.php index 7fc962c7..003f9cd0 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.DeletePathError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.DeletePathError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.DiskSpaceError.php b/src/throwable/error/lowlevel/filesystem/firehub.DiskSpaceError.php index e8c5e402..2cb4c942 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.DiskSpaceError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.DiskSpaceError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetAbsolutePathError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetAbsolutePathError.php index 8e2ea211..8459883b 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetAbsolutePathError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetAbsolutePathError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetContentError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetContentError.php index c4fdb97e..7571cd1d 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetContentError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetContentError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetGroupError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetGroupError.php index 25b13f21..6d5c40fd 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetGroupError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetGroupError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetInodeError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetInodeError.php index ef2c6bce..1f7d0eb8 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetInodeError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetInodeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetLastAccessedError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetLastAccessedError.php index f39ee27f..0605e19b 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetLastAccessedError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetLastAccessedError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetLastChangedError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetLastChangedError.php index ec752f45..f108db76 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetLastChangedError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetLastChangedError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetLastModifiedError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetLastModifiedError.php index 913e41c3..33906a35 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetLastModifiedError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetLastModifiedError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetOwnerError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetOwnerError.php index 0d65e3ac..841e6fcf 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetOwnerError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetOwnerError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetPathSizeError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetPathSizeError.php index 709b822e..67b23445 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetPathSizeError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetPathSizeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetPermissionsError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetPermissionsError.php index 1029deb7..0a225db9 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetPermissionsError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetPermissionsError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetStatisticsError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetStatisticsError.php index 6b3dffd3..48673608 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetStatisticsError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetStatisticsError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.GetSymlinkError.php b/src/throwable/error/lowlevel/filesystem/firehub.GetSymlinkError.php index 4bc23256..6233be00 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.GetSymlinkError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.GetSymlinkError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.MoveUploadedFileError.php b/src/throwable/error/lowlevel/filesystem/firehub.MoveUploadedFileError.php index 8d3b90f3..e99744ab 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.MoveUploadedFileError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.MoveUploadedFileError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.ParentLevelTooSmallError.php b/src/throwable/error/lowlevel/filesystem/firehub.ParentLevelTooSmallError.php index 1c9aa9fb..3b12567c 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.ParentLevelTooSmallError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.ParentLevelTooSmallError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.PathDoesntExistError.php b/src/throwable/error/lowlevel/filesystem/firehub.PathDoesntExistError.php index 4cf07dad..cfe1958e 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.PathDoesntExistError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.PathDoesntExistError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.PutContentError.php b/src/throwable/error/lowlevel/filesystem/firehub.PutContentError.php index 4a0ede57..ce005fd9 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.PutContentError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.PutContentError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.ReadFileError.php b/src/throwable/error/lowlevel/filesystem/firehub.ReadFileError.php index 1398dc1d..85cf750f 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.ReadFileError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.ReadFileError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.RenameError.php b/src/throwable/error/lowlevel/filesystem/firehub.RenameError.php index 495634be..e33b43f9 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.RenameError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.RenameError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.SearchError.php b/src/throwable/error/lowlevel/filesystem/firehub.SearchError.php index 4948be64..2d6eb41f 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.SearchError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.SearchError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.SetGroupError.php b/src/throwable/error/lowlevel/filesystem/firehub.SetGroupError.php index fa6b1b3f..4ad85a42 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.SetGroupError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.SetGroupError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.SetLastAccessAndModifyError.php b/src/throwable/error/lowlevel/filesystem/firehub.SetLastAccessAndModifyError.php index 76241acc..aba6003a 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.SetLastAccessAndModifyError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.SetLastAccessAndModifyError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.SetOwnerError.php b/src/throwable/error/lowlevel/filesystem/firehub.SetOwnerError.php index 2f06c37a..aa1d0567 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.SetOwnerError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.SetOwnerError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/filesystem/firehub.SetPermissionsError.php b/src/throwable/error/lowlevel/filesystem/firehub.SetPermissionsError.php index 8aabca1a..66c0366a 100644 --- a/src/throwable/error/lowlevel/filesystem/firehub.SetPermissionsError.php +++ b/src/throwable/error/lowlevel/filesystem/firehub.SetPermissionsError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\FileSystem; diff --git a/src/throwable/error/lowlevel/func/firehub.RegisterTickFailedError.php b/src/throwable/error/lowlevel/func/firehub.RegisterTickFailedError.php index 3d5b597d..58feccb6 100644 --- a/src/throwable/error/lowlevel/func/firehub.RegisterTickFailedError.php +++ b/src/throwable/error/lowlevel/func/firehub.RegisterTickFailedError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Func; diff --git a/src/throwable/error/lowlevel/json/firehub.DecodeError.php b/src/throwable/error/lowlevel/json/firehub.DecodeError.php index 6f371535..6c0f9d8d 100644 --- a/src/throwable/error/lowlevel/json/firehub.DecodeError.php +++ b/src/throwable/error/lowlevel/json/firehub.DecodeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Json; diff --git a/src/throwable/error/lowlevel/json/firehub.EncodeError.php b/src/throwable/error/lowlevel/json/firehub.EncodeError.php index 79693233..fb1afb05 100644 --- a/src/throwable/error/lowlevel/json/firehub.EncodeError.php +++ b/src/throwable/error/lowlevel/json/firehub.EncodeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Json; diff --git a/src/throwable/error/lowlevel/number/firehub.ArithmeticError.php b/src/throwable/error/lowlevel/number/firehub.ArithmeticError.php index d8c87c43..6edb6adf 100644 --- a/src/throwable/error/lowlevel/number/firehub.ArithmeticError.php +++ b/src/throwable/error/lowlevel/number/firehub.ArithmeticError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Number; diff --git a/src/throwable/error/lowlevel/number/firehub.DivideByZeroError.php b/src/throwable/error/lowlevel/number/firehub.DivideByZeroError.php index 132105b2..55a199a8 100644 --- a/src/throwable/error/lowlevel/number/firehub.DivideByZeroError.php +++ b/src/throwable/error/lowlevel/number/firehub.DivideByZeroError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Number; diff --git a/src/throwable/error/lowlevel/random/firehub.MaxLessThanMinError.php b/src/throwable/error/lowlevel/random/firehub.MaxLessThanMinError.php index 9538d90f..3f3070c0 100644 --- a/src/throwable/error/lowlevel/random/firehub.MaxLessThanMinError.php +++ b/src/throwable/error/lowlevel/random/firehub.MaxLessThanMinError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Random; diff --git a/src/throwable/error/lowlevel/random/firehub.NumberGreaterThanMaxError.php b/src/throwable/error/lowlevel/random/firehub.NumberGreaterThanMaxError.php index cbe7c63a..b40c0bfb 100644 --- a/src/throwable/error/lowlevel/random/firehub.NumberGreaterThanMaxError.php +++ b/src/throwable/error/lowlevel/random/firehub.NumberGreaterThanMaxError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Random; diff --git a/src/throwable/error/lowlevel/random/firehub.NumberLessThanMinError.php b/src/throwable/error/lowlevel/random/firehub.NumberLessThanMinError.php index 27544272..5eb0e0eb 100644 --- a/src/throwable/error/lowlevel/random/firehub.NumberLessThanMinError.php +++ b/src/throwable/error/lowlevel/random/firehub.NumberLessThanMinError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Random; diff --git a/src/throwable/error/lowlevel/random/firehub.SecureNumberError.php b/src/throwable/error/lowlevel/random/firehub.SecureNumberError.php index e8602001..ad3d8b6c 100644 --- a/src/throwable/error/lowlevel/random/firehub.SecureNumberError.php +++ b/src/throwable/error/lowlevel/random/firehub.SecureNumberError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Random; diff --git a/src/throwable/error/lowlevel/regex/firehub.InvalidPatternError.php b/src/throwable/error/lowlevel/regex/firehub.InvalidPatternError.php index 7c21f50d..8fa6b340 100644 --- a/src/throwable/error/lowlevel/regex/firehub.InvalidPatternError.php +++ b/src/throwable/error/lowlevel/regex/firehub.InvalidPatternError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\Regex; diff --git a/src/throwable/error/lowlevel/string/firehub.ChunkLengthLessThanOneError.php b/src/throwable/error/lowlevel/string/firehub.ChunkLengthLessThanOneError.php index db97a6ba..b0a06aa5 100644 --- a/src/throwable/error/lowlevel/string/firehub.ChunkLengthLessThanOneError.php +++ b/src/throwable/error/lowlevel/string/firehub.ChunkLengthLessThanOneError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\String; diff --git a/src/throwable/error/lowlevel/string/firehub.CodepointOutsideValidRangeError.php b/src/throwable/error/lowlevel/string/firehub.CodepointOutsideValidRangeError.php index 4067c5e3..99492b6a 100644 --- a/src/throwable/error/lowlevel/string/firehub.CodepointOutsideValidRangeError.php +++ b/src/throwable/error/lowlevel/string/firehub.CodepointOutsideValidRangeError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\String; diff --git a/src/throwable/error/lowlevel/string/firehub.ComparePartError.php b/src/throwable/error/lowlevel/string/firehub.ComparePartError.php index 8fd81587..dd86a030 100644 --- a/src/throwable/error/lowlevel/string/firehub.ComparePartError.php +++ b/src/throwable/error/lowlevel/string/firehub.ComparePartError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\String; diff --git a/src/throwable/error/lowlevel/string/firehub.EmptyPadError.php b/src/throwable/error/lowlevel/string/firehub.EmptyPadError.php index 56ed87cf..6ecbc17f 100644 --- a/src/throwable/error/lowlevel/string/firehub.EmptyPadError.php +++ b/src/throwable/error/lowlevel/string/firehub.EmptyPadError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\String; diff --git a/src/throwable/error/lowlevel/string/firehub.EmptySeparatorError.php b/src/throwable/error/lowlevel/string/firehub.EmptySeparatorError.php index 5c0ee43a..a4dc17b5 100644 --- a/src/throwable/error/lowlevel/string/firehub.EmptySeparatorError.php +++ b/src/throwable/error/lowlevel/string/firehub.EmptySeparatorError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\String; diff --git a/src/throwable/error/lowlevel/string/firehub.InvalidEncodingError.php b/src/throwable/error/lowlevel/string/firehub.InvalidEncodingError.php index 230869f1..40ebfb70 100644 --- a/src/throwable/error/lowlevel/string/firehub.InvalidEncodingError.php +++ b/src/throwable/error/lowlevel/string/firehub.InvalidEncodingError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\String; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetProcessIDError.php b/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetProcessIDError.php index 8869e55d..570b5e5f 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetProcessIDError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetProcessIDError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetServerAPIError.php b/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetServerAPIError.php index e9ce721e..4d2cf44e 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetServerAPIError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.FailedToGetServerAPIError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.FailedToSetConfigurationOptionError.php b/src/throwable/error/lowlevel/systemruntime/firehub.FailedToSetConfigurationOptionError.php index 5538e8b1..34041550 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.FailedToSetConfigurationOptionError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.FailedToSetConfigurationOptionError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationOptionError.php b/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationOptionError.php index bf4be423..2e99a090 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationOptionError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationOptionError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationQuantityError.php b/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationQuantityError.php index c7f0edd3..9c19e4a3 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationQuantityError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.InvalidConfigurationQuantityError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.InvalidExtensionError.php b/src/throwable/error/lowlevel/systemruntime/firehub.InvalidExtensionError.php index f6365494..e82840ed 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.InvalidExtensionError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.InvalidExtensionError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/lowlevel/systemruntime/firehub.SleepTimeInvalidError.php b/src/throwable/error/lowlevel/systemruntime/firehub.SleepTimeInvalidError.php index eada61c8..27a91e13 100644 --- a/src/throwable/error/lowlevel/systemruntime/firehub.SleepTimeInvalidError.php +++ b/src/throwable/error/lowlevel/systemruntime/firehub.SleepTimeInvalidError.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Error\LowLevel\SystemRuntime; diff --git a/src/throwable/error/valueobject/firehub.InvalidValueObjectError.php b/src/throwable/error/valueobject/firehub.InvalidValueObjectError.php index e15e7a94..db41c251 100644 --- a/src/throwable/error/valueobject/firehub.InvalidValueObjectError.php +++ b/src/throwable/error/valueobject/firehub.InvalidValueObjectError.php @@ -9,11 +9,9 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ -namespace FireHub\Core\Throwable\Error\LowLevel; +namespace FireHub\Core\Throwable\Error\ValueObject; use FireHub\Core\Throwable\Error; diff --git a/src/throwable/exception/domain/autoload/firehub.ImplementationException.php b/src/throwable/exception/domain/autoload/firehub.ImplementationException.php index b69c03cc..136ebed2 100644 --- a/src/throwable/exception/domain/autoload/firehub.ImplementationException.php +++ b/src/throwable/exception/domain/autoload/firehub.ImplementationException.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Exception\Domain\Autoload; diff --git a/src/throwable/exception/domain/autoload/firehub.InvalidFolderException.php b/src/throwable/exception/domain/autoload/firehub.InvalidFolderException.php index 53448d5f..a7b7ddd6 100644 --- a/src/throwable/exception/domain/autoload/firehub.InvalidFolderException.php +++ b/src/throwable/exception/domain/autoload/firehub.InvalidFolderException.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Exception\Domain\Autoload; diff --git a/src/throwable/exception/domain/autoload/firehub.InvalidHandleException.php b/src/throwable/exception/domain/autoload/firehub.InvalidHandleException.php index 5da7387e..782ef76b 100644 --- a/src/throwable/exception/domain/autoload/firehub.InvalidHandleException.php +++ b/src/throwable/exception/domain/autoload/firehub.InvalidHandleException.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Exception\Domain\Autoload; diff --git a/src/throwable/exception/domain/autoload/firehub.InvalidNamespaceException.php b/src/throwable/exception/domain/autoload/firehub.InvalidNamespaceException.php index d7f67d90..ea7a0af1 100644 --- a/src/throwable/exception/domain/autoload/firehub.InvalidNamespaceException.php +++ b/src/throwable/exception/domain/autoload/firehub.InvalidNamespaceException.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\Exception\Domain\Autoload; diff --git a/src/throwable/exception/shared/type/firehub.NoValueException.php b/src/throwable/exception/shared/type/firehub.NoValueException.php new file mode 100644 index 00000000..a1728f23 --- /dev/null +++ b/src/throwable/exception/shared/type/firehub.NoValueException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Shared\Type; + +use FireHub\Core\Throwable\Exception; + +/** + * ### No value present in Maybe exception + * @since 1.0.0 + */ +class NoValueException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'No value present in Maybe.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/bootstrap/firehub.FailedToLoadBootloaderException.php b/src/throwable/exception/support/bootstrap/firehub.FailedToLoadBootloaderException.php similarity index 87% rename from src/throwable/exception/bootstrap/firehub.FailedToLoadBootloaderException.php rename to src/throwable/exception/support/bootstrap/firehub.FailedToLoadBootloaderException.php index 9d445645..41a681c6 100644 --- a/src/throwable/exception/bootstrap/firehub.FailedToLoadBootloaderException.php +++ b/src/throwable/exception/support/bootstrap/firehub.FailedToLoadBootloaderException.php @@ -9,11 +9,9 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ -namespace FireHub\Core\Throwable\Exception\Bootstrap; +namespace FireHub\Core\Throwable\Exception\Support\Bootstrap; use FireHub\Core\Throwable\Exception; diff --git a/src/throwable/exception/bootstrap/firehub.NotBootloaderException.php b/src/throwable/exception/support/bootstrap/firehub.NotBootloaderException.php similarity index 86% rename from src/throwable/exception/bootstrap/firehub.NotBootloaderException.php rename to src/throwable/exception/support/bootstrap/firehub.NotBootloaderException.php index fbd0c0df..1575030f 100644 --- a/src/throwable/exception/bootstrap/firehub.NotBootloaderException.php +++ b/src/throwable/exception/support/bootstrap/firehub.NotBootloaderException.php @@ -9,11 +9,9 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ -namespace FireHub\Core\Throwable\Exception\Bootstrap; +namespace FireHub\Core\Throwable\Exception\Support\Bootstrap; use FireHub\Core\Throwable\Exception; diff --git a/src/throwable/exception/support/datastructure/firehub.EmptyDataStructureException.php b/src/throwable/exception/support/datastructure/firehub.EmptyDataStructureException.php new file mode 100644 index 00000000..68894210 --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.EmptyDataStructureException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure is empty + * @since 1.0.0 + */ +class EmptyDataStructureException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'DataStructure is empty.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.FrozenDataStructureException.php b/src/throwable/exception/support/datastructure/firehub.FrozenDataStructureException.php new file mode 100644 index 00000000..fc4f9f6b --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.FrozenDataStructureException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### Data Structure is frozen + * @since 1.0.0 + */ +class FrozenDataStructureException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Data Structure is frozen.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidBufferException.php b/src/throwable/exception/support/datastructure/firehub.InvalidBufferException.php new file mode 100644 index 00000000..778beabe --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidBufferException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### Invalid buffer exception + * @since 1.0.0 + */ +class InvalidBufferException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Buffer state is invalid.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidCowStateException.php b/src/throwable/exception/support/datastructure/firehub.InvalidCowStateException.php new file mode 100644 index 00000000..c8c6facc --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidCowStateException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### Invalid COW state exception + * @since 1.0.0 + */ +class InvalidCowStateException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Invalid COW state.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidDataStructureException.php b/src/throwable/exception/support/datastructure/firehub.InvalidDataStructureException.php new file mode 100644 index 00000000..b60e6292 --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidDataStructureException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### Data Structure is invalid + * @since 1.0.0 + */ +class InvalidDataStructureException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Invalid Data Structure type.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidEngineException.php b/src/throwable/exception/support/datastructure/firehub.InvalidEngineException.php new file mode 100644 index 00000000..726d3afb --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidEngineException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### Invalid engine exception + * @since 1.0.0 + */ +class InvalidEngineException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Storage engine is invalid.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidKeyException.php b/src/throwable/exception/support/datastructure/firehub.InvalidKeyException.php new file mode 100644 index 00000000..ae416e87 --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidKeyException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure key is invalid + * @since 1.0.0 + */ +class InvalidKeyException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Invalid Data Structure key.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidStorageException.php b/src/throwable/exception/support/datastructure/firehub.InvalidStorageException.php new file mode 100644 index 00000000..5425ccae --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidStorageException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure storage is invalid + * @since 1.0.0 + */ +class InvalidStorageException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Invalid Data Structure storage.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.InvalidValueException.php b/src/throwable/exception/support/datastructure/firehub.InvalidValueException.php new file mode 100644 index 00000000..370e5dcb --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.InvalidValueException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure value is invalid + * @since 1.0.0 + */ +class InvalidValueException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Invalid Data Structure value.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.NodeOwnershipException.php b/src/throwable/exception/support/datastructure/firehub.NodeOwnershipException.php new file mode 100644 index 00000000..52c21bc4 --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.NodeOwnershipException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### Provided node has the wrong ownership + * @since 1.0.0 + */ +class NodeOwnershipException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'Provided node has the wrong ownership.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.OutOfBoundsException.php b/src/throwable/exception/support/datastructure/firehub.OutOfBoundsException.php new file mode 100644 index 00000000..3ad01796 --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.OutOfBoundsException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure is out of bounds exception + * @since 1.0.0 + */ +class OutOfBoundsException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'DataStructure is out of bounds.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.SizeException.php b/src/throwable/exception/support/datastructure/firehub.SizeException.php new file mode 100644 index 00000000..6d0ea08f --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.SizeException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure size + * @since 1.0.0 + */ +class SizeException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'DataStructure size iz wrong.'; + +} \ No newline at end of file diff --git a/src/throwable/exception/support/datastructure/firehub.WrongReturnTypeException.php b/src/throwable/exception/support/datastructure/firehub.WrongReturnTypeException.php new file mode 100644 index 00000000..b6d18cda --- /dev/null +++ b/src/throwable/exception/support/datastructure/firehub.WrongReturnTypeException.php @@ -0,0 +1,31 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @php-version 8.3 + * @package Core\Throwable + */ + +namespace FireHub\Core\Throwable\Exception\Support\DataStructure; + +use FireHub\Core\Throwable\Exception; + +/** + * ### DataStructure returns the wrong type + * @since 1.0.0 + */ +class WrongReturnTypeException extends Exception { + + /** + * @inheritdoc + * + * @since 1.0.0 + */ + protected const string DEFAULT_MESSAGE = 'DataStructure has retuned the wrong type.'; + +} \ No newline at end of file diff --git a/src/throwable/firehub.Builder.php b/src/throwable/firehub.Builder.php index d74d1dfa..c8af92d9 100644 --- a/src/throwable/firehub.Builder.php +++ b/src/throwable/firehub.Builder.php @@ -9,8 +9,6 @@ * * @php-version 8.1 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable; @@ -150,16 +148,16 @@ final public function withPrevious (InternalThrowable $previous):self { } /** - * ### Build and throw the object + * ### Build the Throwable object * @since 1.0.0 * * @uses \FireHub\Core\Shared\Contracts\Throwable To build the object. * * @return TThrowable The built object. */ - public function throw ():Throwable { + public function build ():Throwable { - return throw new $this->exception( + return new $this->exception( $this->message, $this->code, $this->context, diff --git a/src/throwable/firehub.Error.php b/src/throwable/firehub.Error.php index 91b65550..b39a0c92 100644 --- a/src/throwable/firehub.Error.php +++ b/src/throwable/firehub.Error.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable; diff --git a/src/throwable/firehub.ErrorBuilder.php b/src/throwable/firehub.ErrorBuilder.php index 28986ba5..4d839d3f 100644 --- a/src/throwable/firehub.ErrorBuilder.php +++ b/src/throwable/firehub.ErrorBuilder.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable; @@ -26,5 +24,7 @@ * @template TThrowable of \FireHub\Core\Throwable\Error * * @extends \FireHub\Core\Throwable\Builder + * + * @internal */ final class ErrorBuilder extends Builder {} \ No newline at end of file diff --git a/src/throwable/firehub.Exception.php b/src/throwable/firehub.Exception.php index c00c6be6..6f4c4161 100644 --- a/src/throwable/firehub.Exception.php +++ b/src/throwable/firehub.Exception.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable; diff --git a/src/throwable/firehub.ExceptionBuilder.php b/src/throwable/firehub.ExceptionBuilder.php index 835f33a9..38ee10c2 100644 --- a/src/throwable/firehub.ExceptionBuilder.php +++ b/src/throwable/firehub.ExceptionBuilder.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable; @@ -27,5 +25,7 @@ * @template TThrowable of \FireHub\Core\Throwable\Exception * * @extends \FireHub\Core\Throwable\Builder + * + * @internal */ final class ExceptionBuilder extends Builder {} \ No newline at end of file diff --git a/src/throwable/firehub.Throwable.php b/src/throwable/firehub.Throwable.php index 0517d89f..ab38477f 100644 --- a/src/throwable/firehub.Throwable.php +++ b/src/throwable/firehub.Throwable.php @@ -9,8 +9,6 @@ * * @php-version 8.3 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable; diff --git a/src/throwable/valueobject/firehub.Code.php b/src/throwable/valueobject/firehub.Code.php index 1c8dd98d..08b7e5c1 100644 --- a/src/throwable/valueobject/firehub.Code.php +++ b/src/throwable/valueobject/firehub.Code.php @@ -9,8 +9,6 @@ * * @php-version 8.2 * @package Core\Throwable - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Core\Throwable\ValueObject; @@ -37,7 +35,7 @@ * The error code. *

* - * @throws \FireHub\Core\Throwable\Error\LowLevel\InvalidValueObjectError If the code is negative. + * @throws \FireHub\Core\Throwable\Error\ValueObject\InvalidValueObjectError If the code is negative. * * @return void */ diff --git a/tests/dataproviders/firehub.ArrDataProvider.php b/tests/dataproviders/firehub.ArrDataProvider.php index a668e52a..bc91cbd5 100644 --- a/tests/dataproviders/firehub.ArrDataProvider.php +++ b/tests/dataproviders/firehub.ArrDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.ClsObjDataProvider.php b/tests/dataproviders/firehub.ClsObjDataProvider.php index 48412915..946fddcd 100644 --- a/tests/dataproviders/firehub.ClsObjDataProvider.php +++ b/tests/dataproviders/firehub.ClsObjDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.ConstantDataProvider.php b/tests/dataproviders/firehub.ConstantDataProvider.php index 2b5fbfa9..2221d18c 100644 --- a/tests/dataproviders/firehub.ConstantDataProvider.php +++ b/tests/dataproviders/firehub.ConstantDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.DataDataProvider.php b/tests/dataproviders/firehub.DataDataProvider.php index 77388652..4ccc39fc 100644 --- a/tests/dataproviders/firehub.DataDataProvider.php +++ b/tests/dataproviders/firehub.DataDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.DataStructureDataProvider.php b/tests/dataproviders/firehub.DataStructureDataProvider.php new file mode 100644 index 00000000..8674f07b --- /dev/null +++ b/tests/dataproviders/firehub.DataStructureDataProvider.php @@ -0,0 +1,36 @@ + + * @copyright 2026 The FireHub Project - All rights reserved + * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 + * + * @package Core\Test + */ + +namespace FireHub\Tests\DataProviders; + +use FireHub\Core\Support\DataStructure\ArrayCollection; + +/** + * ### Datastructure data provider + * @since 1.0.0 + */ +final class DataStructureDataProvider { + + /** + * @since 1.0.0 + * + * @return array + */ + public static function collection ():array { + + return [ + [new ArrayCollection(['John', 'Jane', 'Jane', 'Jane', 'Richard', 'Richard'])] + ]; + + } + +} \ No newline at end of file diff --git a/tests/dataproviders/firehub.DateTimeDataProvider.php b/tests/dataproviders/firehub.DateTimeDataProvider.php index d1e57d1e..a386357d 100644 --- a/tests/dataproviders/firehub.DateTimeDataProvider.php +++ b/tests/dataproviders/firehub.DateTimeDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.NumDataProvider.php b/tests/dataproviders/firehub.NumDataProvider.php index fafe68df..74e1a000 100644 --- a/tests/dataproviders/firehub.NumDataProvider.php +++ b/tests/dataproviders/firehub.NumDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.ResourceDataProvider.php b/tests/dataproviders/firehub.ResourceDataProvider.php index 74cc3d73..0e972d3c 100644 --- a/tests/dataproviders/firehub.ResourceDataProvider.php +++ b/tests/dataproviders/firehub.ResourceDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/dataproviders/firehub.StrDataProvider.php b/tests/dataproviders/firehub.StrDataProvider.php index f0a065c1..caf813ec 100644 --- a/tests/dataproviders/firehub.StrDataProvider.php +++ b/tests/dataproviders/firehub.StrDataProvider.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\DataProviders; diff --git a/tests/unit/FireHubTest.php b/tests/unit/FireHubTest.php index bc589a73..6669170e 100644 --- a/tests/unit/FireHubTest.php +++ b/tests/unit/FireHubTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit; @@ -39,8 +37,8 @@ final class FireHubTest extends Base { /** * @since 1.0.0 * - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException * * @return void */ diff --git a/tests/unit/domain/autoload/HandleTest.php b/tests/unit/domain/autoload/HandleTest.php index 952ea4bd..3e0f2dc1 100644 --- a/tests/unit/domain/autoload/HandleTest.php +++ b/tests/unit/domain/autoload/HandleTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Domain\Autoload; diff --git a/tests/unit/shared/enums/OrderTest.php b/tests/unit/shared/enums/OrderTest.php index 0a503337..2d5e782e 100644 --- a/tests/unit/shared/enums/OrderTest.php +++ b/tests/unit/shared/enums/OrderTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Shared\Enums; diff --git a/tests/unit/shared/enums/data/TypeTest.php b/tests/unit/shared/enums/data/TypeTest.php index 54747f3d..213875bc 100644 --- a/tests/unit/shared/enums/data/TypeTest.php +++ b/tests/unit/shared/enums/data/TypeTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Shared\Enums\Data; diff --git a/tests/unit/shared/enums/number/LogBaseTest.php b/tests/unit/shared/enums/number/LogBaseTest.php index 876d6441..70d96e5f 100644 --- a/tests/unit/shared/enums/number/LogBaseTest.php +++ b/tests/unit/shared/enums/number/LogBaseTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Shared\Enums\Number; diff --git a/tests/unit/shared/enums/number/RoundTest.php b/tests/unit/shared/enums/number/RoundTest.php index fe2f51cd..fc67e9d5 100644 --- a/tests/unit/shared/enums/number/RoundTest.php +++ b/tests/unit/shared/enums/number/RoundTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Shared\Enums\Number; diff --git a/tests/unit/support/AutoloadTest.php b/tests/unit/support/AutoloadTest.php index 38908cfa..a42797a9 100644 --- a/tests/unit/support/AutoloadTest.php +++ b/tests/unit/support/AutoloadTest.php @@ -8,11 +8,9 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ -namespace FireHub\Tests\Unit\Domain\Autoload; +namespace FireHub\Tests\Unit\Support; use FireHub\Core\Testing\Base; use FireHub\Core\Support\Autoload; diff --git a/tests/unit/support/autoload/loader/ClassmapTest.php b/tests/unit/support/autoload/loader/ClassmapTest.php index 662d9a6d..17ae1f1c 100644 --- a/tests/unit/support/autoload/loader/ClassmapTest.php +++ b/tests/unit/support/autoload/loader/ClassmapTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\Autoload\Loader; diff --git a/tests/unit/support/autoload/loader/ResolverTest.php b/tests/unit/support/autoload/loader/ResolverTest.php index a8e642f2..4fa2ca37 100644 --- a/tests/unit/support/autoload/loader/ResolverTest.php +++ b/tests/unit/support/autoload/loader/ResolverTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\Autoload\Loader; diff --git a/tests/unit/support/bootstrap/FireHubConfiguratorTest.php b/tests/unit/support/bootstrap/FireHubConfiguratorTest.php index 644866c8..119d1f18 100644 --- a/tests/unit/support/bootstrap/FireHubConfiguratorTest.php +++ b/tests/unit/support/bootstrap/FireHubConfiguratorTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\Bootstrap; @@ -71,8 +69,8 @@ public function testWithBootloaders (array $bootloaders):void { /** * @since 1.0.0 * - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\FailedToLoadBootloaderException - * @throws \FireHub\Core\Throwable\Exception\Bootstrap\NotBootloaderException + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\FailedToLoadBootloaderException + * @throws \FireHub\Core\Throwable\Exception\Support\Bootstrap\NotBootloaderException * * @return void */ diff --git a/tests/unit/support/bootstrap/bootloader/RegisterAutoloadersTest.php b/tests/unit/support/bootstrap/bootloader/RegisterAutoloadersTest.php index cde7ff35..1f4283ed 100644 --- a/tests/unit/support/bootstrap/bootloader/RegisterAutoloadersTest.php +++ b/tests/unit/support/bootstrap/bootloader/RegisterAutoloadersTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\Bootstrap\Bootloader; diff --git a/tests/unit/support/bootstrap/bootloader/RegisterConstantsTest.php b/tests/unit/support/bootstrap/bootloader/RegisterConstantsTest.php index 888f2264..514f42b4 100644 --- a/tests/unit/support/bootstrap/bootloader/RegisterConstantsTest.php +++ b/tests/unit/support/bootstrap/bootloader/RegisterConstantsTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\Bootstrap\Bootloader; diff --git a/tests/unit/support/bootstrap/bootloader/RegisterHelpersTest.php b/tests/unit/support/bootstrap/bootloader/RegisterHelpersTest.php index 89285c7e..91ac8dbc 100644 --- a/tests/unit/support/bootstrap/bootloader/RegisterHelpersTest.php +++ b/tests/unit/support/bootstrap/bootloader/RegisterHelpersTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\Bootstrap\Bootloader; diff --git a/tests/unit/support/lowlevel/ArrTest.php b/tests/unit/support/lowlevel/ArrTest.php index 8d784ad1..c499c585 100644 --- a/tests/unit/support/lowlevel/ArrTest.php +++ b/tests/unit/support/lowlevel/ArrTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; @@ -89,9 +87,9 @@ public function testAny (bool $expected, array $array, mixed $result):void { #[TestWith([true, 2, [1, 2, 3]])] #[TestWith([false, 3, [1, 2, 3]])] #[TestWith([false, 'x', [null, 2, 3]])] - public function testKeyExist (bool $expected, int|string $key, array $array):void { + public function testKeyExists (bool $expected, int|string $key, array $array):void { - self::assertSame($expected, Arr::keyExist($key, $array)); + self::assertSame($expected, Arr::keyExists($key, $array)); } diff --git a/tests/unit/support/lowlevel/CharMBTest.php b/tests/unit/support/lowlevel/CharMBTest.php index efebc8ff..011f8302 100644 --- a/tests/unit/support/lowlevel/CharMBTest.php +++ b/tests/unit/support/lowlevel/CharMBTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/CharSBTest.php b/tests/unit/support/lowlevel/CharSBTest.php index e5d2a939..0d3958dd 100644 --- a/tests/unit/support/lowlevel/CharSBTest.php +++ b/tests/unit/support/lowlevel/CharSBTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/ClsObjTest.php b/tests/unit/support/lowlevel/ClsObjTest.php index 05459fca..421bdb50 100644 --- a/tests/unit/support/lowlevel/ClsObjTest.php +++ b/tests/unit/support/lowlevel/ClsObjTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/ConstantTest.php b/tests/unit/support/lowlevel/ConstantTest.php index 4462bd11..f18a292f 100644 --- a/tests/unit/support/lowlevel/ConstantTest.php +++ b/tests/unit/support/lowlevel/ConstantTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/DataTest.php b/tests/unit/support/lowlevel/DataTest.php index 06cf9160..c3ad38c3 100644 --- a/tests/unit/support/lowlevel/DataTest.php +++ b/tests/unit/support/lowlevel/DataTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/DateAndTimeTest.php b/tests/unit/support/lowlevel/DateAndTimeTest.php index 57295bef..d8a254eb 100644 --- a/tests/unit/support/lowlevel/DateAndTimeTest.php +++ b/tests/unit/support/lowlevel/DateAndTimeTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/DeclaredTest.php b/tests/unit/support/lowlevel/DeclaredTest.php index 3510beb3..cc9b2b03 100644 --- a/tests/unit/support/lowlevel/DeclaredTest.php +++ b/tests/unit/support/lowlevel/DeclaredTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/FuncTest.php b/tests/unit/support/lowlevel/FuncTest.php index 2ba1ca47..d71d11df 100644 --- a/tests/unit/support/lowlevel/FuncTest.php +++ b/tests/unit/support/lowlevel/FuncTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/IteratorTest.php b/tests/unit/support/lowlevel/IteratorTest.php index 827853ca..fd25ad57 100644 --- a/tests/unit/support/lowlevel/IteratorTest.php +++ b/tests/unit/support/lowlevel/IteratorTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/JsonTest.php b/tests/unit/support/lowlevel/JsonTest.php index 40721e69..48cf009e 100644 --- a/tests/unit/support/lowlevel/JsonTest.php +++ b/tests/unit/support/lowlevel/JsonTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/MathTest.php b/tests/unit/support/lowlevel/MathTest.php index 3ddaa0de..542f2956 100644 --- a/tests/unit/support/lowlevel/MathTest.php +++ b/tests/unit/support/lowlevel/MathTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/RandomTest.php b/tests/unit/support/lowlevel/RandomTest.php index 9f258ecb..f9ee31ae 100644 --- a/tests/unit/support/lowlevel/RandomTest.php +++ b/tests/unit/support/lowlevel/RandomTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/RegexMBTest.php b/tests/unit/support/lowlevel/RegexMBTest.php index 50191a9a..60c1eada 100644 --- a/tests/unit/support/lowlevel/RegexMBTest.php +++ b/tests/unit/support/lowlevel/RegexMBTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/RegexTest.php b/tests/unit/support/lowlevel/RegexTest.php index daf3d8df..c8f8e332 100644 --- a/tests/unit/support/lowlevel/RegexTest.php +++ b/tests/unit/support/lowlevel/RegexTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/ResourcesTest.php b/tests/unit/support/lowlevel/ResourcesTest.php index dda095e6..52022857 100644 --- a/tests/unit/support/lowlevel/ResourcesTest.php +++ b/tests/unit/support/lowlevel/ResourcesTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/SplAutoloadTest.php b/tests/unit/support/lowlevel/SplAutoloadTest.php index 07f2b0f9..7f257de9 100644 --- a/tests/unit/support/lowlevel/SplAutoloadTest.php +++ b/tests/unit/support/lowlevel/SplAutoloadTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/StrMBTest.php b/tests/unit/support/lowlevel/StrMBTest.php index 5e3ae2af..82178078 100644 --- a/tests/unit/support/lowlevel/StrMBTest.php +++ b/tests/unit/support/lowlevel/StrMBTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; diff --git a/tests/unit/support/lowlevel/StrSBTest.php b/tests/unit/support/lowlevel/StrSBTest.php index 75cfa2c7..3cc07759 100644 --- a/tests/unit/support/lowlevel/StrSBTest.php +++ b/tests/unit/support/lowlevel/StrSBTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel; @@ -963,4 +961,19 @@ public function testFormat (string $expected, string $format, null|bool|float|in } + /** + * @since 1.0.0 + * + * @param int $expected + * @param string $string + * + * @return void + */ + #[TestWith([2191738434, 'The quick brown fox jumped over the lazy dog.'])] + public function testCrc32 (int $expected, string $string):void { + + self::assertSame($expected, StrSB::crc32($string)); + + } + } \ No newline at end of file diff --git a/tests/unit/support/lowlevel/SystemRuntimeTest.php b/tests/unit/support/lowlevel/SystemRuntimeTest.php index 47e83e71..e3113139 100644 --- a/tests/unit/support/lowlevel/SystemRuntimeTest.php +++ b/tests/unit/support/lowlevel/SystemRuntimeTest.php @@ -8,8 +8,6 @@ * @license https://opensource.org/license/Apache-2-0 Apache License, Version 2.0 * * @package Core\Test - * - * @version GIT: $Id$ Blob checksum. */ namespace FireHub\Tests\Unit\Support\LowLevel;