Download the PHP package aegisora/boolean-rule without Composer
On this page you can find all versions of the php package aegisora/boolean-rule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aegisora/boolean-rule
More information about aegisora/boolean-rule
Files in aegisora/boolean-rule
Package boolean-rule
Short Description Rule-based boolean value equality validation in Aegisora ecosystem
License MIT
Homepage https://github.com/Aegisora/boolean-rule
Informations about the package boolean-rule
Aegisora Boolean Rule
Boolean Rule provides a simple and strict boolean value equality validation for the Aegisora ecosystem.
The package is built on top of aegisora/rule-contract and follows its validation architecture, ensuring predictable and safe behavior.
✨ Features
- 🔹 Minimalistic implementation with no extra dependencies
- 🔹 Strict type validation (
boolonly) - 🔹 Comparison using
=== - 🔹 Supports validation for both
trueandfalse - 🔹 Fully compatible with Aegisora validation pipeline
- 🔹 Clear
Context → Resultflow - 🔹 No raw booleans — only structured
Result - 🔹 Safe execution via base
Ruleabstraction - 🔹 Convenient factory methods (
createTruthy,createFalsy) - 🔹 Built-in input validation
📦 Installation
🚀 Core Concept
This package performs boolean validation:
- accepts a value via
Context - ensures the value is of type
bool - compares it with the expected value
- returns a standardized
Result
Supported values:
truefalse
Any other value will result in an exception.
🏗️ Basic Usage
✅ Validate true
❌ Validate false
🧩 Factory Methods
createTruthy()— expectstruecreateFalsy()— expectsfalse
⚠️ Validation Rules
The input value must strictly be a boolean:
truefalse
Any other type (int, string, null, etc.) will throw an exception:
Aegisora\RuleContract\Exceptions\InvalidRuleContextException
🏛️ Architecture
This package relies on aegisora/rule-contract.
Validation flow:
validate()is calledContextis passedexecuteValidate()is executed- Value type is validated (
boolonly) - Strict comparison (
===) is performed - A
Resultis returned
All logic is encapsulated within the base Rule abstraction.
⚖️ License
This package is open-source and licensed under the MIT License. See the LICENSE for details.
🌱 Contributing
Contributions are welcome and greatly appreciated!. See the CONTRIBUTING for details.
🌟 Support
If you find this project useful, please consider giving it a star on GitHub!
It helps the project grow and motivates further development.