execute read-the-docs.sh

This commit is contained in:
Faust
2015-04-02 00:03:33 +02:00
parent c6cc7f2131
commit bba8b0df43
40 changed files with 2491 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
Purpose
=======
Examples
========
-
Code
----
You can also find these code on `GitHub`_
Wheel.php
.. literalinclude:: Wheel.php
:language: php
:linenos:
Door.php
.. literalinclude:: Door.php
:language: php
:linenos:
Car.php
.. literalinclude:: Car.php
:language: php
:linenos:
Bike.php
.. literalinclude:: Bike.php
:language: php
:linenos:
Vehicle.php
.. literalinclude:: Vehicle.php
:language: php
:linenos:
Engine.php
.. literalinclude:: Engine.php
:language: php
:linenos:
Test
----
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Builder/Parts

View File

@@ -0,0 +1,68 @@
Builder
=======
Purpose
-------
Builder is an interface that build parts of a complex object.
Sometimes, if the builder has a better knowledge of what it builds, this
interface could be an abstract class with default methods (aka adapter).
If you have a complex inheritance tree for objects, it is logical to
have a complex inheritance tree for builders too.
Note: Builders have often a fluent interface, see the mock builder of
PHPUnit for example.
Examples
--------
- PHPUnit: Mock Builder
UML Diagram
-----------
.. image:: uml/uml.png
:alt: Alt Builder UML Diagram
:align: center
Code
----
You can also find these code on `GitHub`_
BuilderInterface.php
.. literalinclude:: BuilderInterface.php
:language: php
:linenos:
CarBuilder.php
.. literalinclude:: CarBuilder.php
:language: php
:linenos:
Director.php
.. literalinclude:: Director.php
:language: php
:linenos:
BikeBuilder.php
.. literalinclude:: BikeBuilder.php
:language: php
:linenos:
Test
----
Tests/DirectorTest.php
.. literalinclude:: Tests/DirectorTest.php
:language: php
:linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Builder