mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-02 21:17:29 +02:00
README FluentInterface
This commit is contained in:
11
FluentInterface/README.md
Normal file
11
FluentInterface/README.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 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
|
@@ -3,15 +3,7 @@
|
|||||||
namespace DesignPatterns\FluentInterface;
|
namespace DesignPatterns\FluentInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fluent interface pattern
|
* class SQL
|
||||||
*
|
|
||||||
* Purpose:
|
|
||||||
* to write code that is easy readable just like "real" sentences
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
*/
|
||||||
class SQL
|
class SQL
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user