PHPackages                             voku/itp-context - 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. voku/itp-context

ActiveLibrary

voku/itp-context
================

Architecture context attributes, catalogs, validation and summarization helpers for PHP projects.

0.1.1(4d ago)01MITPHPPHP &gt;=8.3.0CI passing

Since Mar 18Pushed 4d agoCompare

[ Source](https://github.com/voku/itp-context)[ Packagist](https://packagist.org/packages/voku/itp-context)[ Docs](https://github.com/voku/itp-context)[ RSS](/packages/voku-itp-context/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/59f28d10c04477cf69a7873686f64478e76ca4bf347b7bc7102c2fcb0cf8bdd3/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f6974702d636f6e746578742f762f737461626c65)](https://packagist.org/packages/voku/itp-context)[![Total Downloads](https://camo.githubusercontent.com/fd6b2521a4a185e7f6406f2e500526622997447e3c5a820f769ca6433ed1da5c/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f6974702d636f6e746578742f646f776e6c6f616473)](https://packagist.org/packages/voku/itp-context)[![License](https://camo.githubusercontent.com/3fb7def1d5390a7e09b93c6f0897f42e7eb28c82cf1b44aff629d873a0706c8f/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f6974702d636f6e746578742f6c6963656e7365)](https://packagist.org/packages/voku/itp-context)

itp-context
===========

[](#itp-context)

A small PHP library for attaching architecture rules to code via PHP attributes and resolving those rules from a matching catalog.

It gives you:

- typed rule identifiers via enums
- `#[Rule(...)]` attributes for classes and methods
- rule catalogs with ownership, rationale, references and proof metadata
- validation helpers for stale or orphaned catalog entries
- summary output for annotated PHP symbols
- a small generator for bootstrapping new rule enums and catalogs

Index
-----

[](#index)

- [Install](#install-via-composer-require)
- [Why?](#why)
- [Usage](#usage)
- [Local Development](#local-development)
- [Project Structure](#project-structure)
- [CLI Tools](#cli-tools)
- [Tests](#tests)
- [License](#license)

Install via "composer require"
------------------------------

[](#install-via-composer-require)

```
composer require voku/itp-context
```

Why?
----

[](#why)

When architecture guidance only lives in ADRs and wikis, it drifts away from the code that is supposed to follow it.

`itp-context` keeps the rule identifier in the code, the rule definition in a nearby catalog and the proof references in one typed structure. That gives you a compact way to:

- attach architecture intent to classes and methods
- validate whether enum cases and catalog entries still match
- summarize relevant architecture context for one PHP file

Usage
-----

[](#usage)

### 1. Create a rule enum in your project

[](#1-create-a-rule-enum-in-your-project)

```
