To write code that is easy readable just like sentences in a natural language (like English).
- Doctrine2's QueryBuilder works something like that example class below
- PHPUnit uses fluent interfaces to build mock objects
You can also find this code on GitHub
Sql.php
.. literalinclude:: Sql.php :language: php :linenos:
Tests/FluentInterfaceTest.php
.. literalinclude:: Tests/FluentInterfaceTest.php :language: php :linenos: