mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-24 07:19:44 +02:00
12 lines
336 B
Markdown
12 lines
336 B
Markdown
# Fluent Interface
|
|
|
|
## Purpose
|
|
|
|
To write code that is easy readable just like sentences in a natural language (like English).
|
|
|
|
## Examples
|
|
|
|
* Doctrine2's QueryBuilder works something like that example class below
|
|
* PHPUnit uses fluent interfaces to build mock objects
|
|
* Yii Framework: CDbCommand and CActiveRecord use this pattern, too
|