PHPackages                             componenta/policy-app - 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. [Caching](/categories/caching)
4. /
5. componenta/policy-app

ActiveLibrary[Caching](/categories/caching)

componenta/policy-app
=====================

Componenta application integration for policy cache compilation

v1.0.0(1mo ago)08MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/componenta/policy-app)[ Packagist](https://packagist.org/packages/componenta/policy-app)[ RSS](/packages/componenta-policy-app/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Componenta Policy App
=====================

[](#componenta-policy-app)

Application-level compile integration for `componenta/policy`. This package turns policy attributes into serializable descriptors that can be loaded from production cache by the runtime policy provider.

Use it in a Componenta application cache build. Runtime code that only evaluates policies should depend on `componenta/policy`.

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

[](#installation)

```
composer require componenta/policy-app
```

The package declares `Componenta\Policy\App\ConfigProvider` in `extra.componenta.config-providers`. When `componenta/composer-plugin` is installed, the provider is added to the generated provider list automatically.

Related Packages
----------------

[](#related-packages)

PackageWhy it matters here`componenta/policy`Enforces policies and consumes compiled policy descriptors.`componenta/class-finder`Finds classes and public methods with policy attributes.`componenta/app`Runs the compiler only when policy support is installed and bound.What It Adds
------------

[](#what-it-adds)

The package provides `Componenta\Policy\App\Compile\PolicyMapCompiler`.

The compiler scans discovered classes for policy attributes on:

- classes
- public methods

It returns a descriptor map keyed by action id. `CompiledPolicyProvider` from `componenta/policy` consumes those descriptors at runtime.

Development Mode
----------------

[](#development-mode)

In development, policy metadata may be read through reflection or rebuilt during cache warmup. This is useful while classes and attributes are changing.

Production Mode
---------------

[](#production-mode)

In production, the application should load compiled descriptors instead of scanning source files. This keeps request startup deterministic and avoids repeated reflection over command/query/controller classes.

The compiler should be enabled only when `componenta/policy` is installed and a policy provider binding exists. `componenta/app` performs that feature gating through compile support.

Failure Behavior
----------------

[](#failure-behavior)

Runtime policy enforcement stays in `componenta/policy`. If a compiled descriptor is stale or malformed, the runtime provider handles that as a runtime policy concern. The app package only produces the descriptor map.

Boundaries
----------

[](#boundaries)

`componenta/policy-app` must not contain authorization decisions. Policy contracts, attributes, providers, policy composition, and enforcement belong to `componenta/policy`; this package owns only application compile integration.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

43d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/componenta-policy-app/health.svg)

```
[![Health](https://phpackages.com/badges/componenta-policy-app/health.svg)](https://phpackages.com/packages/componenta-policy-app)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
