Skip to content

Files

Latest commit

author
Dominik Liebler
Sep 24, 2013
1d166d4 · Sep 24, 2013

History

History
This branch is 1009 commits behind DesignPatternsPHP/DesignPatternsPHP:main.

FluentInterface

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 24, 2013
Sep 24, 2013

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