# aimeos/macro

Customize code using closures

Repository: https://github.com/aimeos/macro
Canonical: https://ross.abutalabs.com/products/aimeos-macro
Homepage: https://php-macro.org
Language: PHP
License: MIT
License Family: permissive
Topics: php, macro, macros, dynamic, extend, class, inherit, closure, customize, custom
Last push: 2026-01-12T16:12:07+00:00

## Health v2 (maintenance only)
Score: 60/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 62, release rhythm 35, longevity 100
- inputs: {"age_days": 1735, "days_push": 233, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2431, forks 1 (observed 2026-08-28T04:06:51.094631+00:00)

## What it is
A PHP library providing a Macroable trait that lets developers add closure-based extension points to their classes, allowing users to override or extend methods without subclassing. It uses pure PHP methods with no reflection and supports macro inheritance and access to class properties.

## Use cases
- let users customize framework behavior without extending classes
- add extension points to library methods using closures
- override method results in base classes via registered macros
- allow macros to access private class properties
- inherit and overwrite macros from parent classes
- lightweight alternative to class-based dependency injection for small hooks

## When to choose
- you build an application, framework, or library meant for user customization
- you need simple extension points where full DI with interfaces is overkill
- you want closures that behave like inherited, overridable methods

## When to avoid
- you need strict static analysis or interface contracts on injected behavior
- you require full class-based dependency injection with type-safe implementations

## Facets
- artifact type: library
- maturity: stable
- function: middleware, plugin-system, developer-tools
- domain: developer-tools, web-development, programming-languages
- platform: php
- tags: macros, closures, dependency-injection, trait, extensibility, method-overriding

## Member repositories
- aimeos/macro (main) score 60

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:51.094631+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:31:25.330035+00:00, confidence not recorded.
  - readme: https://github.com/aimeos/macro (fetched 2026-08-28T04:06:51.094631+00:00, sha 0555e8c88dd3)
  - homepage: https://php-macro.org (fetched 2026-08-29T10:12:37.785314+00:00, sha b1a00b7292d5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
