{"id":17437126,"url":"https://github.com/kariricode-framework/kariricode-property-inspector","last_synced_at":"2026-02-06T11:03:55.515Z","repository":{"id":257826139,"uuid":"872448577","full_name":"KaririCode-Framework/kariricode-property-inspector","owner":"KaririCode-Framework","description":"Powerful attribute-based property analysis and inspection tool for KaririCode Framework, enabling dynamic validation, normalization, and processing of object properties","archived":false,"fork":false,"pushed_at":"2024-10-26T13:01:09.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T01:05:53.082Z","etag":null,"topics":["attribute","dynamic-analysis","framework","framework-php","inspection","kariri-code","metadata","normalization","object-properties","php","property-inspector","reflection"],"latest_commit_sha":null,"homepage":"https://kariricode.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KaririCode-Framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-14T13:05:35.000Z","updated_at":"2024-10-26T13:01:13.000Z","dependencies_parsed_at":"2024-10-22T18:58:01.115Z","dependency_job_id":null,"html_url":"https://github.com/KaririCode-Framework/kariricode-property-inspector","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.11764705882352944","last_synced_commit":"7e70c17b74c69601514fa40a4f76aeb0c056e096"},"previous_names":["kariricode-framework/kariricode-property-inspector"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/KaririCode-Framework/kariricode-property-inspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaririCode-Framework%2Fkariricode-property-inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaririCode-Framework%2Fkariricode-property-inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaririCode-Framework%2Fkariricode-property-inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaririCode-Framework%2Fkariricode-property-inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KaririCode-Framework","download_url":"https://codeload.github.com/KaririCode-Framework/kariricode-property-inspector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KaririCode-Framework%2Fkariricode-property-inspector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29158571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attribute","dynamic-analysis","framework","framework-php","inspection","kariri-code","metadata","normalization","object-properties","php","property-inspector","reflection"],"created_at":"2024-10-17T11:05:55.117Z","updated_at":"2026-02-06T11:03:55.477Z","avatar_url":"https://github.com/KaririCode-Framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KaririCode Framework: PropertyInspector Component\n\n[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md) [![pt-br](https://img.shields.io/badge/lang-pt--br-green.svg)](README.pt-br.md)\n\n![PHP](https://img.shields.io/badge/PHP-777BB4?style=for-the-badge\u0026logo=php\u0026logoColor=white) ![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge\u0026logo=docker\u0026logoColor=white) ![PHPUnit](https://img.shields.io/badge/PHPUnit-3776AB?style=for-the-badge\u0026logo=php\u0026logoColor=white)\n\nA 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.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Basic Usage](#basic-usage)\n  - [Advanced Usage](#advanced-usage)\n- [Integration with Other KaririCode Components](#integration-with-other-kariricode-components)\n- [Development and Testing](#development-and-testing)\n- [License](#license)\n- [Support and Community](#support-and-community)\n- [Acknowledgements](#acknowledgements)\n\n## Features\n\n- Easy inspection and processing of object properties based on custom attributes\n- Support for both validation and sanitization of property values\n- Flexible attribute handling through custom attribute handlers\n- Seamless integration with other KaririCode components (Serializer, Validator, Normalizer)\n- Extensible architecture allowing custom attributes and handlers\n- Built on top of the KaririCode\\Contract interfaces for maximum flexibility\n\n## Installation\n\nThe PropertyInspector component can be easily installed via Composer, which is the recommended dependency manager for PHP projects.\n\nTo install the PropertyInspector component in your project, run the following command in your terminal:\n\n```bash\ncomposer require kariricode/property-inspector\n```\n\nThis command will automatically add PropertyInspector to your project and install all necessary dependencies.\n\n### Requirements\n\n- PHP 8.1 or higher\n- Composer\n\n### Manual Installation\n\nIf you prefer not to use Composer, you can download the source code directly from the [GitHub repository](https://github.com/KaririCode-Framework/kariricode-property-inspector) and include it manually in your project. However, we strongly recommend using Composer for easier dependency management and updates.\n\nAfter installation, you can start using PropertyInspector in your PHP project immediately. Make sure to include the Composer autoloader in your script:\n\n```php\nrequire_once 'vendor/autoload.php';\n```\n\n## Usage\n\n### Basic Usage\n\n1. Define your custom attributes and entity:\n\n```php\nuse Attribute;\n\n#[Attribute(Attribute::TARGET_PROPERTY)]\nclass Validate\n{\n    public function __construct(public readonly array $rules) {}\n}\n\n#[Attribute(Attribute::TARGET_PROPERTY)]\nclass Sanitize\n{\n    public function __construct(public readonly string $method) {}\n}\n\nclass User\n{\n    public function __construct(\n        #[Validate(['required', 'string', 'min:3'])]\n        #[Sanitize('trim')]\n        public string $name,\n        #[Validate(['required', 'email'])]\n        #[Sanitize('lowercase')]\n        public string $email,\n        #[Validate(['required', 'integer', 'min:18'])]\n        public int $age\n    ) {}\n}\n```\n\n2. Create a custom attribute handler:\n\n```php\nuse KaririCode\\PropertyInspector\\Contract\\PropertyAttributeHandler;\n\nclass CustomAttributeHandler implements PropertyAttributeHandler\n{\n    public function handleAttribute(object $object, string $propertyName, object $attribute, mixed $value): ?string\n    {\n        if ($attribute instanceof Validate) {\n            return $this-\u003evalidate($propertyName, $value, $attribute-\u003erules);\n        }\n        if ($attribute instanceof Sanitize) {\n            return $this-\u003esanitize($value, $attribute-\u003emethod);\n        }\n        return null;\n    }\n\n    // Implement validate and sanitize methods...\n}\n```\n\n3. Use the PropertyInspector:\n\n```php\nuse KaririCode\\PropertyInspector\\AttributeAnalyzer;\nuse KaririCode\\PropertyInspector\\PropertyInspector;\n\n$attributeAnalyzer = new AttributeAnalyzer(Validate::class);\n$propertyInspector = new PropertyInspector($attributeAnalyzer);\n$handler = new CustomAttributeHandler();\n\n$user = new User('Walmir Silva', 'walmir@example.com', 25);\n\n$results = $propertyInspector-\u003einspect($user, $handler);\n```\n\n### Advanced Usage\n\nYou can create more complex validation and sanitization rules, and even combine the PropertyInspector with other components like the ProcessorPipeline for more advanced processing flows.\n\n## Integration with Other KaririCode Components\n\nThe PropertyInspector component is designed to work seamlessly with other KaririCode components:\n\n- **KaririCode\\Serializer**: Use PropertyInspector to validate and sanitize data before serialization.\n- **KaririCode\\Validator**: Integrate custom validation logic with PropertyInspector attributes.\n- **KaririCode\\Normalizer**: Use PropertyInspector to normalize object properties based on attributes.\n\n## Development and Testing\n\nFor development and testing purposes, this package uses Docker and Docker Compose to ensure consistency across different environments. A Makefile is provided for convenience.\n\n### Prerequisites\n\n- Docker\n- Docker Compose\n- Make (optional, but recommended for easier command execution)\n\n### Development Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/KaririCode-Framework/kariricode-property-inspector.git\n   cd kariricode-property-inspector\n   ```\n\n2. Set up the environment:\n\n   ```bash\n   make setup-env\n   ```\n\n3. Start the Docker containers:\n\n   ```bash\n   make up\n   ```\n\n4. Install dependencies:\n   ```bash\n   make composer-install\n   ```\n\n### Available Make Commands\n\n- `make up`: Start all services in the background\n- `make down`: Stop and remove all containers\n- `make build`: Build Docker images\n- `make shell`: Access the PHP container shell\n- `make test`: Run tests\n- `make coverage`: Run test coverage with visual formatting\n- `make cs-fix`: Run PHP CS Fixer to fix code style\n- `make quality`: Run all quality commands (cs-check, test, security-check)\n\nFor a full list of available commands, run:\n\n```bash\nmake help\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support and Community\n\n- **Documentation**: [https://kariricode.org/docs/property-inspector](https://kariricode.org/docs/property-inspector)\n- **Issue Tracker**: [GitHub Issues](https://github.com/KaririCode-Framework/kariricode-property-inspector/issues)\n- **Community**: [KaririCode Club Community](https://kariricode.club)\n\n## Acknowledgements\n\n- The KaririCode Framework team and contributors.\n- Inspired by attribute-based programming and reflection patterns in modern PHP applications.\n\n---\n\nBuilt with ❤️ by the KaririCode team. Empowering developers to create more robust and flexible PHP applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkariricode-framework%2Fkariricode-property-inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkariricode-framework%2Fkariricode-property-inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkariricode-framework%2Fkariricode-property-inspector/lists"}