PHPackages                             zhikiri/pdecorate - 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. zhikiri/pdecorate

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

zhikiri/pdecorate
=================

Python like function decoration in PHP

v2.0.2(8y ago)19MITPHP

Since Dec 19Pushed 8y agoCompare

[ Source](https://github.com/zhikiri/pdecorate)[ Packagist](https://packagist.org/packages/zhikiri/pdecorate)[ RSS](/packages/zhikiri-pdecorate/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (1)Versions (9)Used By (0)

pdecorate
=========

[](#pdecorate)

[![CircleCI](https://camo.githubusercontent.com/64fa62ac0a0cfc678039b517ecd3e5ee5ea1ea09393a2dbcf05a7b719dc57d48/68747470733a2f2f636972636c6563692e636f6d2f67682f7a68696b6972692f706465636f726174652f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/zhikiri/pdecorate/tree/master)

Simulation of the Python decorators in PHP

Install with composer: `composer require zhikiri/pdecorate`

Description
-----------

[](#description)

Creation of the new decorator, second parameter *must be* callable.

Allow to use class methods, function names and Closure class instances (anonymous function)

```
Pdecorate::add('italic', function ($content) {
  return "{$content}";
});
```

Get instance of the decoration

First of all pass the decorators and the last parameter **must be** the callable function.

```
$decoration = new Decorator(
    'italic',
    function () {
        return 'decoration text';
    }
);
```

Decoration execution:

- cast to string `(string)$decoration`
- execute the Decorator instance `$decoration()`
- run the Decorator call method `$decoration->call()`

Result of the current decoration will be: `decoration text`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity68

Established project with proven stability

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 ~127 days

Recently: every ~191 days

Total

7

Last Release

3034d ago

Major Versions

v1.1.0 → v2.0.02018-01-22

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zhikiri-pdecorate/health.svg)

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

PHPackages © 2026

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