生成器在 PHP 中的实现
Builder is a creational design pattern, which allows constructing complex objects step by step.
Unlike other creational patterns, Builder doesn't require products to have a common interface. That makes it possible to produce different products using the same construction process.
在 PHP 中使用模式
Usage examples: The Builder pattern is a well-known pattern in PHP world. It's especially useful when you need to create an object with lots of possible configuration options.