PHPackages                             marcin-orlowski/lombok-php - 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. marcin-orlowski/lombok-php

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

marcin-orlowski/lombok-php
==========================

Never write boilerplate code for your data class again!

1.2.0(4mo ago)3118.6k↓37.5%1[2 issues](https://github.com/MarcinOrlowski/lombok-php/issues)1LGPL-3.0-onlyPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5CI passing

Since Apr 16Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/MarcinOrlowski/lombok-php)[ Packagist](https://packagist.org/packages/marcin-orlowski/lombok-php)[ Docs](https://github.com/MarcinOrlowski/lombok-php)[ RSS](/packages/marcin-orlowski-lombok-php/feed)WikiDiscussions master Synced 1mo ago

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

[![Lombok PHP - write less code!](artwork/lombok-php-logo.png)](artwork/lombok-php-logo.png)

---

[![Latest Stable Version](https://camo.githubusercontent.com/cb8ca9e3aab262e55ee497ba03f430d717f76c72efdc44dbb91e4a2ca5cdbc44/68747470733a2f2f706f7365722e707567782e6f72672f6d617263696e2d6f726c6f77736b692f6c6f6d626f6b2d7068702f76)](https://packagist.org/packages/marcin-orlowski/lombok-php)[![codecov](https://camo.githubusercontent.com/7bd97931055c844627ae5c2d02c5a4ead446b04664f0e548192241e8980483b1/68747470733a2f2f636f6465636f762e696f2f67682f4d617263696e4f726c6f77736b692f6c6f6d626f6b2d7068702f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d4d444f534f504b5a3843)](https://codecov.io/gh/MarcinOrlowski/lombok-php)[![License](https://camo.githubusercontent.com/12b8e8c4f94cee6b6f3f0161652057871ad993ee8be71697fc6e36b6016f8b57/68747470733a2f2f706f7365722e707567782e6f72672f6d617263696e2d6f726c6f77736b692f6c6f6d626f6b2d7068702f6c6963656e7365)](https://packagist.org/packages/marcin-orlowski/lombok-php)

---

Table of contents
=================

[](#table-of-contents)

- [Introduction](#introduction)
- [Why should I use it?](#benefits)
- [Usage examples](#examples)
- [Documentation](docs/README.md)
- [License](#license)
- [Changelog](CHANGES.md)

---

Introduction
------------

[](#introduction)

`Lombok PHP` is a package offering a growing set of [PHP attributes](https://www.php.net/manual/en/language.attributes.php) (a feature [introduced in PHP 8.0](https://www.php.net/releases/8.0/)) designed to help reduce boilerplate code in your project by providing commonly used functionality that can be easily applied.

The main goal is to provide all the functionality **at runtime**, without any intermediate steps needed and **without generating any additional code files**.

And yes, the project name is shamelessly borrowed from the beloved Java's [Project Lombok](https://projectlombok.org/). However, it is not affiliated in any way; it's merely a nod to the scope and (target) functionality.

Benefits
--------

[](#benefits)

- Less code to write and maintain,
- No more repetitive boilerplate code,
- Can coexist with other attributes (i.e., [Doctrine](https://www.doctrine-project.org/), etc.),
- No code generation (all handled on-the-fly),
- No additional dependencies,
- Supports object cloning,
- Production ready.

Examples
--------

[](#examples)

Vanilla PHP:

```
class Entity {
    protected int    $id;
    protected string $name;
    protected ?int   $age;

    public function getId(): int
    {
      return $this->id;
    }

    public function getName(): string
    {
        return $this->name;
    }
    public function setName(string $name): static
    {
        $this->name = $name;
        return $this;
    }

    public function getAge(): ?int
    {
        return $this->age;
    }
    public function setAge(?int $age): static
    {
        $this->age = $age;
        return $this;
    }
}
```

Using `Lombok PHP` (inheritance from `\Lombok\Helper` is helpful but [optional](docs/README.md#manual-wiring)):

```
use Lombok\Getter;
use Lombok\Setter;

#[Setter, Getter]
class Entity extends \Lombok\Helper {
    #[Getter]
    protected int $id;

    protected string $name;
    protected ?int $age;
}
```

[Click here](docs/README.md) to see setup instruction and all the technical details.

License
-------

[](#license)

- Written and copyrighted ©2022-2026 by Marcin Orlowski &lt;mail (#) marcinorlowski (.) com&gt;
- `Lombok PHP` is open-sourced software licensed under the [LGPL 3.0](https://opensource.org/licenses/LGPL-3.0)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance75

Regular maintenance activity

Popularity36

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

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

Total

4

Last Release

130d ago

PHP version history (3 changes)1.0.0PHP ^8.0|^8.1

1.1.0PHP ^8.0|^8.1|^8.2

1.2.0PHP ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/8870db56c4a0f54e86e6d574b761bac8654795bdad7b52b3ccdb6a42f0d4af80?d=identicon)[MarcinOrlowski](/maintainers/MarcinOrlowski)

---

Top Contributors

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

---

Tags

lomboklombok-phpphp-attributesphp8phpannotationsannotationphp8accessorsgetterssetterslombok

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marcin-orlowski-lombok-php/health.svg)

```
[![Health](https://phpackages.com/badges/marcin-orlowski-lombok-php/health.svg)](https://phpackages.com/packages/marcin-orlowski-lombok-php)
```

PHPackages © 2026

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