Download the PHP package kariricode/property-inspector without Composer
On this page you can find all versions of the php package kariricode/property-inspector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kariricode/property-inspector
More information about kariricode/property-inspector
Files in kariricode/property-inspector
Package property-inspector
Short Description A robust and flexible data sanitization component for PHP, part of the KaririCode Framework, utilizing configurable processors and native functions.
License MIT
Homepage https://kariricode.org
Informations about the package property-inspector
KaririCode Framework: PropertyInspector Component
A powerful and flexible component for inspecting and processing object properties based on custom attributes in the KaririCode Framework, providing advanced features for property validation, sanitization, and analysis in PHP applications.
Table of Contents
- Features
- Installation
- Usage
- Basic Usage
- Advanced Usage
- Integration with Other KaririCode Components
- Development and Testing
- License
- Support and Community
- Acknowledgements
Features
- Easy inspection and processing of object properties based on custom attributes
- Support for both validation and sanitization of property values
- Flexible attribute handling through custom attribute handlers
- Seamless integration with other KaririCode components (Serializer, Validator, Normalizer)
- Extensible architecture allowing custom attributes and handlers
- Built on top of the KaririCode\Contract interfaces for maximum flexibility
Installation
The PropertyInspector component can be easily installed via Composer, which is the recommended dependency manager for PHP projects.
To install the PropertyInspector component in your project, run the following command in your terminal:
This command will automatically add PropertyInspector to your project and install all necessary dependencies.
Requirements
- PHP 8.1 or higher
- Composer
Manual Installation
If you prefer not to use Composer, you can download the source code directly from the GitHub repository and include it manually in your project. However, we strongly recommend using Composer for easier dependency management and updates.
After installation, you can start using PropertyInspector in your PHP project immediately. Make sure to include the Composer autoloader in your script:
Usage
Basic Usage
-
Define your custom attributes and entity:
-
Create a custom attribute handler:
- Use the PropertyInspector:
Advanced Usage
You can create more complex validation and sanitization rules, and even combine the PropertyInspector with other components like the ProcessorPipeline for more advanced processing flows.
Integration with Other KaririCode Components
The PropertyInspector component is designed to work seamlessly with other KaririCode components:
- KaririCode\Serializer: Use PropertyInspector to validate and sanitize data before serialization.
- KaririCode\Validator: Integrate custom validation logic with PropertyInspector attributes.
- KaririCode\Normalizer: Use PropertyInspector to normalize object properties based on attributes.
Development and Testing
For development and testing purposes, this package uses Docker and Docker Compose to ensure consistency across different environments. A Makefile is provided for convenience.
Prerequisites
- Docker
- Docker Compose
- Make (optional, but recommended for easier command execution)
Development Setup
-
Clone the repository:
-
Set up the environment:
-
Start the Docker containers:
- Install dependencies:
Available Make Commands
make up
: Start all services in the backgroundmake down
: Stop and remove all containersmake build
: Build Docker imagesmake shell
: Access the PHP container shellmake test
: Run testsmake coverage
: Run test coverage with visual formattingmake cs-fix
: Run PHP CS Fixer to fix code stylemake quality
: Run all quality commands (cs-check, test, security-check)
For a full list of available commands, run:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support and Community
- Documentation: https://kariricode.org/docs/property-inspector
- Issue Tracker: GitHub Issues
- Community: KaririCode Club Community
Acknowledgements
- The KaririCode Framework team and contributors.
- Inspired by attribute-based programming and reflection patterns in modern PHP applications.
Built with ❤️ by the KaririCode team. Empowering developers to create more robust and flexible PHP applications.