Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Decorator Bundle Laravel Package

libre-informatique/decorator-bundle

Libre Informatique Decorator Bundle provides reusable decorator-pattern support for Symfony applications, letting you wrap services or objects with extra behavior while keeping core classes clean and extensible.

View on GitHub
Deep Wiki
Context7

Getting Started

Reality check before anything else. libre-informatique/decorator-bundle is a Symfony bundle, not a Laravel package. There is no DecoratorServiceProvider, no facade, no extra.laravel.providers entry, and no config file Laravel would auto-discover. composer require it in a Laravel app and the *Bundle class is dead code — at best you end up using whatever plain PHP classes live under src/ as a raw library. The realistic day-to-day leverage for a Laravel developer is the pattern, not the package.

If you are actually on Symfony (or spiking on one), the minimal steps are:

composer require libre-informatique/decorator-bundle
// config/bundles.php
return [
    // ...
    LibreInformatique\DecoratorBundle\DecoratorBundle::class => ['all' => true],
];

Where to look first. There is no meaningful README, so the source is the documentation. Read in this order:

  1. src/DependencyInjection/ — the Extension and Configuration classes tell you what the bundle actually registers and what knobs exist.
  2. src/Resources/config/ — the services.yaml/.xml that wires the decorator machinery.
  3. Whatever lives alongside the *Bundle class — expect a small Decorator/, Attribute/, or abstract base class. That folder is the entire value proposition.
  4. composer.json — check the PHP floor and Symfony constraints before you invest time; this vendor's code is likely Symfony 3/4-era.

First use case. The bundle exists to wrap services so you can add behaviour (logging, caching, validation, formatting) without editing the wrapped class. The smallest meaningful exercise on Symfony is a wrapper around one of your own interfaces:

final class LoggingPriceCalculator implements PriceCalculatorInterface
{
    public function __construct(private PriceCalculatorInterface $inner) {}

    public function calculate(Basket $basket): Money
    {
        $result = $this->inner->calculate($basket);
        // log $basket and $result
        return $result;
    }
}
# services.yaml
App\Pricing\PriceCalculator: ~

App\Pricing\LoggingPriceCalculator:
    decorates: App\Pricing\PriceCalculator
    arguments: ['@.inner']

If PriceCalculator::calculate() is still reached and your log line fires, the wiring works. Everything else in the bundle is a convenience layer over that mechanism — and Sym

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
cgv/localized-resource