Download the PHP package aegisora/scalar-equality-rule without Composer
On this page you can find all versions of the php package aegisora/scalar-equality-rule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aegisora/scalar-equality-rule
More information about aegisora/scalar-equality-rule
Files in aegisora/scalar-equality-rule
Package scalar-equality-rule
Short Description Rule-based scalar equality validation in Aegisora ecosystem
License MIT
Homepage https://github.com/Aegisora/scalar-equality-rule
Informations about the package scalar-equality-rule
Aegisora Scalar Equality Rule
Scalar Equality Rule provides a simple, rule-based scalar value comparison implementation for the Aegisora ecosystem.
It is built on top of aegisora/rule-contract (https://github.com/Aegisora/rule-contract) and follows its strict validation architecture, ensuring consistent and predictable behavior across applications.
✨ Features
- 🔹 Lightweight and dependency-free (except rule contract)
- 🔹 Strict scalar comparison using
=== - 🔹 Supports both equality and inequality checks
- 🔹 Fully compatible with Aegisora validation pipeline
- 🔹 Strict
Context → Resultvalidation flow - 🔹 No raw booleans — only structured results
- 🔹 Safe execution via base
Ruleabstraction - 🔹 Convenient factory methods (
createEqual,createNotEqual) - 🔹 Built-in validation of input values
📦 Installation
🚀 Core Concept
This package implements scalar comparison validation:
- accepts a value via
Context - compares it to an expected scalar value
- uses strict comparison (
===) - returns a standardized
Result
Supported values:
- scalar types (
int,float,string,bool) null
Any non-scalar value will result in an exception.
🏗️ Basic Usage
✅ Equality check
❌ Inequality check
🧩 Factory Methods
$expectedValue— scalar value ornull
⚠️ Validation Rules
Both expected value and input value must be:
- scalar (
int,float,string,bool) - or
null
Otherwise, an exception will be thrown:
🏛️ Architecture
This package relies on aegisora/rule-contract (https://github.com/Aegisora/rule-contract).
Validation flow:
validate()is calledContextis passed inexecuteValidate()runs- Values are validated as scalar or null
- Strict comparison (
===) is performed Resultis returned
All logic is safely 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.