php-builder-generator

PHP Builder Generator Documentation

Welcome to the PHP Builder Generator documentation! This library helps you automatically generate builder patterns for your PHP classes using simple attributes.

What is PHP Builder Generator?

PHP Builder Generator is a Composer plugin that automatically creates builder classes for your PHP objects. Instead of manually writing repetitive builder code, you simply add a #[Builder] attribute to your class and the generator does the rest.

Key Benefits

Quick Example

#[Builder]
class User
{
    public function __construct(
        public string $name,
        public string $email,
        public ?int $age = null
    ) {}
}

// Generated builder usage:
$user = UserBuilder::builder()
    ->name('John Doe')
    ->email('john@example.com')
    ->age(30)
    ->build();

Documentation Sections

Getting Started

Features & Configuration

Examples

Contributing

Requirements

Support


Ready to get started? Check out the Quick Start Guide!