PHPackages                             kariricode/property-inspector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. kariricode/property-inspector

ActiveLibrary[Framework](/categories/framework)

kariricode/property-inspector
=============================

Attribute-based property analysis and inspection for the KaririCode Framework, enabling dynamic validation, normalization, and processing of object properties via PHP 8.4+ attributes and reflection.

v2.0.0(3mo ago)01.1k4MITPHPPHP ^8.4CI passing

Since Oct 14Pushed 3mo agoCompare

[ Source](https://github.com/KaririCode-Framework/kariricode-property-inspector)[ Packagist](https://packagist.org/packages/kariricode/property-inspector)[ Docs](https://kariricode.org)[ RSS](/packages/kariricode-property-inspector/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (18)Used By (4)

KaririCode PropertyInspector
============================

[](#kariricode-propertyinspector)

[![PHP 8.4+](https://camo.githubusercontent.com/270717987f5341772d79b57567226e54ed27b2d4199bbdc98a96e2edf24902fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342532422d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/1e64768fef09f35b66921728160f533208fd2e3e792a2755187d16c25d535511/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d3232633535652e737667)](LICENSE)[![PHPStan Level 9](https://camo.githubusercontent.com/a812723b363d3726b682e5d739e91f2ade163846054ce3797b9085b84cc61806/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230392d344634364535)](https://phpstan.org/)[![Tests](https://camo.githubusercontent.com/0cf1f915b00a466396c5c59279bce1848352730d58b69ba841d5781fe563c79c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d343025323070617373696e672d323263353565)](https://kariricode.org)[![ARFA](https://camo.githubusercontent.com/708efab30524ab8fd4e0413edfb4378bb863a71559c4a9b59cdcb7b0ab6f65c0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f415246412d312e332d6f72616e6765)](https://kariricode.org)[![KaririCode Framework](https://camo.githubusercontent.com/bd3e3709bf161ac982b76f7afd06c39afe478d15f2b5e1d47df8606b5c9c03f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4b6172697269436f64652d4672616d65776f726b2d6f72616e6765)](https://kariricode.org)

**Attribute-based property analysis and inspection for the KaririCode Framework —
multi-pass pipelines, reflection caching, and zero-overhead property mutation, PHP 8.4+.**

[Installation](#installation) · [Quick Start](#quick-start) · [Features](#features) · [Pipeline](#the-inspection-pipeline) · [Architecture](#architecture)

---

The Problem
-----------

[](#the-problem)

PHP reflection is boilerplate-heavy, error-prone, and slow when repeated across object graphs:

```
// The old way: raw reflection on every request
$ref = new ReflectionClass($user);
foreach ($ref->getProperties() as $prop) {
    $attrs = $prop->getAttributes(Validate::class);
    foreach ($attrs as $attr) {
        $prop->setAccessible(true); // deprecated in PHP 8.4
        $value = $prop->getValue($user);
        // now what? where does the result go? how do you write it back?
    }
}
```

No caching, no mutation abstraction, no error isolation, no handler contract — just raw loops you repeat in every project.

The Solution
------------

[](#the-solution)

```
use KaririCode\PropertyInspector\AttributeAnalyzer;
use KaririCode\PropertyInspector\Utility\PropertyInspector;
use KaririCode\PropertyInspector\Utility\PropertyAccessor;

// 1. Configure which attribute to scan for
$analyzer  = new AttributeAnalyzer(Validate::class);
$inspector = new PropertyInspector($analyzer);

// 2. Inspect — results cached after first call per class
$handler = new MyValidationHandler();
$inspector->inspect($user, $handler);

// 3. Read processed values and errors
$values = $handler->getProcessedPropertyValues();
$errors = $handler->getProcessingResultErrors();

// 4. Write back changed values via PropertyAccessor
$accessor = new PropertyAccessor($user, 'email');
$accessor->setValue(strtolower($accessor->getValue()));
```

---

Requirements
------------

[](#requirements)

RequirementVersionPHP8.4 or higherkariricode/contract^2.8kariricode/exception^1.2---

Installation
------------

[](#installation)

```
composer require kariricode/property-inspector
```

---

Quick Start
-----------

[](#quick-start)

Define an attribute, an entity, a handler — and inspect:

```
