PHPackages                             intentsolutions/symfony-lombok-bumbu - 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. intentsolutions/symfony-lombok-bumbu

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

intentsolutions/symfony-lombok-bumbu
====================================

049PHP

Since Aug 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/intentsolutions/symfony-lombok-bumbu)[ Packagist](https://packagist.org/packages/intentsolutions/symfony-lombok-bumbu)[ RSS](/packages/intentsolutions-symfony-lombok-bumbu/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Lombok for Symfony
==================

[](#lombok-for-symfony)

Welcome to Bumbu! This library aims to simplify your Symfony development by providing powerful annotations that automate repetitive tasks. Here you will find detailed documentation on how to install, configure, and use Bumbu in your Symfony projects.

---

Table of Contents
-----------------

[](#table-of-contents)

1. [Introduction](#introduction)
2. [Installation](#installation)
3. [Configuration](#configuration)
4. [Attributes](#attributes)
    - [RequestBody](#requestbody)
    - [Valid](#valid)
    - [Getter](#getter)
    - [Setter](#setter)
5. [Usage Examples](#usage-examples)
6. [Contributing](#contributing)
7. [License](#license)

---

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

[](#introduction)

Bumbu is a Symfony library inspired by Lombok, designed to reduce boilerplate code in your projects. With Bumbu, you can use custom attributes to streamline common tasks such as request handling, validation, and getter/setter generation.

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

[](#installation)

To install Bumbu, use Composer:

```
composer require intentsolutions/symfony-lombok-bumbu:dev-main
```

Configuration
-------------

[](#configuration)

After installing Bumbu, you need to enable it in your Symfony project.

1. Add Bumbu to bundles.php:

```
return [
   // Other bundles
   IS\Bumbu\BumbuBundle::class => ['all' => true],
];
```

2. Update Doctrine Configuration in config/packages/doctrine.yaml:

```
doctrine:
    orm:
        class_metadata_factory_name: IS\Bumbu\Doctrine\CustomClassMetadataFactory
```

Attributes
----------

[](#attributes)

Bumbu provides several useful attributes to make your Symfony development smoother:

### RequestBody

[](#requestbody)

The RequestBody attribute maps the request body directly to a parameter in your controller action.

Usage:

```
use IS\Bumbu\Attribute\RequestBody;

class MyController extends AbstractController
{
    #[Route('/endpoint', name: 'endpoint', methods: ['POST'])]
    public function myAction(#[RequestBody] MyRequestDto $dto)
    {
        // $dto will be automatically filled with data from the request body
    }
}
```

### Valid

[](#valid)

The Valid attribute triggers validation on the given parameter. It is often used together with the RequestBody attribute to validate data automatically when it is mapped from the request body.

```
use IS\Bumbu\Attribute\RequestBody;
use IS\Bumbu\Attribute\Valid;

class MyController extends AbstractController
{
    #[Route('/endpoint', name: 'endpoint', methods: ['POST'])]
    public function myAction(#[RequestBody, Valid] MyRequestDto $dto)
    {
        // The $dto parameter will be populated from the request body and validated automatically
    }
}
```

### Getter

[](#getter)

The Getter attribute generates a getter method for a specified property.

```
use IS\Bumbu\Attribute\Getter;

class MyEntity
{
    #[Getter]
    private $property;

    // Bumbu will create a getProperty() method
}
```

### Setter

[](#setter)

The Setter attribute generates a setter method for a specified property.

```
use IS\Bumbu\Attribute\Setter;

class MyEntity
{
    #[Setter]
    private $property;

    // Bumbu will create a setProperty($value) method
}
```

Usage Examples
--------------

[](#usage-examples)

### Example 1: Using RequestBody and Valid

[](#example-1-using-requestbody-and-valid)

```
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Type;

class MyRequestDto
{
    #[NotBlank]
    #[Length(min: 3)]
    private string $name;

    #[NotBlank]
    #[Type(type: 'integer')]
    private int $age;

    #[NotBlank]
    #[Email]
    private string $email;
}
```

```
use IS\Bumbu\Attribute\RequestBody;
use IS\Bumbu\Attribute\Valid;

class MyController extends AbstractController
{
    #[Route('/submit', name: 'submit', methods: ['POST'])]
    public function submit(#[RequestBody, Valid] MyRequestDto $dto)
    {
        // Handle the validated request DTO
    }
}
```

### Example 2: Using Get and Set

[](#example-2-using-get-and-set)

```
use IS\Bumbu\Attribute\Get;
use IS\Bumbu\Attribute\Set;

class User
{
    #[Getter]
    #[Setter]
    private $username;

    #[Getter]
    private $email;

    #[Setter]
    private $password;

    // Bumbu will generate getUsername(), setUsername($value), getEmail(), and setPassword($value) methods
}
```

**Note**: To use the User class with the generated getter and setter methods, you should create an instance of it through dependency injection (DI) where applicable.

```
use App\Entity\User;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

class SomeController extends AbstractController
{
    public function someAction(User $user): Response
    {
        $username = $user->getUsername();
        // Use $username and other methods as needed

        return new Response('User username is ' . $username);
    }
}
```

Contributing
------------

[](#contributing)

I welcome contributions to Bumbu! If you want to help out, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Implement your changes and add tests.
4. Submit a pull request with a clear description of what you’ve done.

### License

[](#license)

Bumbu is licensed under the MIT License. See the LICENSE file for more details.

---

Thanks for using Bumbu! I hope it makes your Symfony development easier. If you have any questions or feedback, feel free to open an issue on the GitHub repository.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/43c729afd5dd2b7ace70e29d8cd99b76da4c7442c4c96cc931f1da0e7cc9ee75?d=identicon)[intent-solutions](/maintainers/intent-solutions)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/intentsolutions-symfony-lombok-bumbu/health.svg)

```
[![Health](https://phpackages.com/badges/intentsolutions-symfony-lombok-bumbu/health.svg)](https://phpackages.com/packages/intentsolutions-symfony-lombok-bumbu)
```

###  Alternatives

[philperusse/nova-tooltip-field

A Laravel Nova field.

10246.0k](/packages/philperusse-nova-tooltip-field)[beholdr/filament-trilist

Filament plugin that adds components for working with tree data: treeselect and treeview

1120.6k](/packages/beholdr-filament-trilist)

PHPackages © 2026

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