PHPackages                             fyre/macro - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fyre/macro

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fyre/macro
==========

A macro utility library.

v2.0.1(6mo ago)02.0k20MITPHP

Since Jul 27Pushed 6mo agoCompare

[ Source](https://github.com/elusivecodes/FyreMacro)[ Packagist](https://packagist.org/packages/fyre/macro)[ RSS](/packages/fyre-macro/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (20)

FyreMacro
=========

[](#fyremacro)

**FyreMacro** is a free, open-source macro utility library for *PHP*.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Macros](#macros)
    - [Calling Macros](#calling-macros)
- [Static Macros](#static-macros)
    - [Calling Static Macros](#calling-static-macros)

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

[](#installation)

**Using Composer**

```
composer require fyre/macro

```

Macros
------

[](#macros)

You can attach `Fyre\Utility\Traits\MacroTrait` to any class.

```
use Fyre\Utility\Traits\MacroTrait;

// in any class
class MyClass {
    use MacroTrait;
}
```

**Clear Macros**

Clear all macros.

```
MyClass::clearMacros();
```

**Has Macro**

Determine whether a macro is registered.

- `$name` is a string representing the name of the macro.

```
$hasMacro = MyClass::hasMacro($name);
```

**Macro**

Register a macro.

- `$name` is a string representing the name of the macro.
- `$callback` is the macro callback.

```
MyClass::macro($name, $callback);
```

### Calling Macros

[](#calling-macros)

```
MyClass::macro('myMethod', function(): bool {
    return true;
});

new MyClass()->myMethod(); // true
```

Static Macros
-------------

[](#static-macros)

You can attach `Fyre\Utility\Traits\StaticMacroTrait` to any class.

```
use Fyre\Utility\Traits\StaticMacroTrait;

// in any class
class MyClass {
    use StaticMacroTrait;
}
```

**Clear Static Macros**

Clear all static macros.

```
MyClass::clearStaticMacros();
```

**Has Static Macro**

Determine whether a static macro is registered.

- `$name` is a string representing the name of the macro.

```
$hasStaticMacro = MyClass::hasStaticMacro($name);
```

**Static Macro**

Register a static macro.

- `$name` is a string representing the name of the macro.
- `$callback` is the macro callback.

```
MyClass::staticMacro($name, $callback);
```

### Calling Static Macros

[](#calling-static-macros)

```
MyClass::staticMacro('myMethod', function(): bool {
    return true;
});

MyClass::myMethod(); // true
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance66

Regular maintenance activity

Popularity19

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Every ~43 days

Total

3

Last Release

208d ago

Major Versions

v1.0 → v2.02025-09-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/fad81fd5941e3a637c8a5749d05ae3ed9314d5e2fee57f59c3d9ec3b41259c6b?d=identicon)[elusivecodes](/maintainers/elusivecodes)

---

Top Contributors

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

---

Tags

macrophputility

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fyre-macro/health.svg)

```
[![Health](https://phpackages.com/badges/fyre-macro/health.svg)](https://phpackages.com/packages/fyre-macro)
```

###  Alternatives

[phpcr/phpcr-migrations

Migrations for PHPCR

421.4M2](/packages/phpcr-phpcr-migrations)[wablas/wablas-client-php

(Unoficial) Wablas Client PHP

141.4k](/packages/wablas-wablas-client-php)

PHPackages © 2026

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