Download the PHP package aegisora/in-array-rule without Composer
On this page you can find all versions of the php package aegisora/in-array-rule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aegisora/in-array-rule
More information about aegisora/in-array-rule
Files in aegisora/in-array-rule
Package in-array-rule
Short Description Rule-based in-array validation in Aegisora ecosystem
License MIT
Homepage https://github.com/Aegisora/in-array-rule
Informations about the package in-array-rule
Aegisora In-Array Rule
In-Array Rule provides a simple, rule-based array membership validation 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 and soft comparison modes (
in_arraybehavior) - 🔹 Fully compatible with Aegisora validation pipeline
- 🔹 Strict
Context → Resultvalidation flow - 🔹 No raw booleans — only structured results
- 🔹 Safe execution via base
Ruleabstraction - 🔹 Simple factory API (
create,createStrict,createSoft) - 🔹 Ready to use out of the box
📦 Installation
🚀 Core Concept
This package implements a single validation rule:
- accepts a value via
Context - checks whether it exists in a predefined array
- returns a standardized
Result
Internally uses PHP native function:
🏗️ Basic Usage
🔒 Strict vs Soft Mode
Strict mode (default)
Strict comparison checks type as well.
Soft mode
Allows loose comparison (== behavior).
🧩 Factory Methods
🏛️ Architecture
This package relies on aegisora/rule-contract (https://github.com/Aegisora/rule-contract).
Flow:
validate()is calledContextis passed inexecuteValidate()runsin_arraycheck is executedResultis returned
All logic is safely handled by Rule contract.
⚖️ 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.