mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-03 13:37:27 +02:00
sort php files Creational
This commit is contained in:
@@ -21,9 +21,9 @@ Code
|
|||||||
|
|
||||||
You can also find these code on `GitHub`_
|
You can also find these code on `GitHub`_
|
||||||
|
|
||||||
Text.php
|
AbstractFactory.php
|
||||||
|
|
||||||
.. literalinclude:: Text.php
|
.. literalinclude:: AbstractFactory.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
@@ -33,9 +33,9 @@ JsonFactory.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
AbstractFactory.php
|
HtmlFactory.php
|
||||||
|
|
||||||
.. literalinclude:: AbstractFactory.php
|
.. literalinclude:: HtmlFactory.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
@@ -45,27 +45,15 @@ MediaInterface.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
HtmlFactory.php
|
|
||||||
|
|
||||||
.. literalinclude:: HtmlFactory.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Picture.php
|
Picture.php
|
||||||
|
|
||||||
.. literalinclude:: Picture.php
|
.. literalinclude:: Picture.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
Html/Picture.php
|
Text.php
|
||||||
|
|
||||||
.. literalinclude:: Html/Picture.php
|
.. literalinclude:: Text.php
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Html/Text.php
|
|
||||||
|
|
||||||
.. literalinclude:: Html/Text.php
|
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
@@ -81,6 +69,18 @@ Json/Text.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
Html/Picture.php
|
||||||
|
|
||||||
|
.. literalinclude:: Html/Picture.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
Html/Text.php
|
||||||
|
|
||||||
|
.. literalinclude:: Html/Text.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
Test
|
Test
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@@ -32,27 +32,51 @@ Code
|
|||||||
|
|
||||||
You can also find these code on `GitHub`_
|
You can also find these code on `GitHub`_
|
||||||
|
|
||||||
|
Director.php
|
||||||
|
|
||||||
|
.. literalinclude:: Director.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
BuilderInterface.php
|
BuilderInterface.php
|
||||||
|
|
||||||
.. literalinclude:: BuilderInterface.php
|
.. literalinclude:: BuilderInterface.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
BikeBuilder.php
|
||||||
|
|
||||||
|
.. literalinclude:: BikeBuilder.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
CarBuilder.php
|
CarBuilder.php
|
||||||
|
|
||||||
.. literalinclude:: CarBuilder.php
|
.. literalinclude:: CarBuilder.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
Director.php
|
Parts/Vehicle.php
|
||||||
|
|
||||||
.. literalinclude:: Director.php
|
.. literalinclude:: Parts/Vehicle.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
BikeBuilder.php
|
Parts/Bike.php
|
||||||
|
|
||||||
.. literalinclude:: BikeBuilder.php
|
.. literalinclude:: Parts/Bike.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
Parts/Car.php
|
||||||
|
|
||||||
|
.. literalinclude:: Parts/Car.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
|
Parts/Engine.php
|
||||||
|
|
||||||
|
.. literalinclude:: Parts/Engine.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
@@ -68,30 +92,6 @@ Parts/Door.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
Parts/Car.php
|
|
||||||
|
|
||||||
.. literalinclude:: Parts/Car.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Parts/Bike.php
|
|
||||||
|
|
||||||
.. literalinclude:: Parts/Bike.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Parts/Vehicle.php
|
|
||||||
|
|
||||||
.. literalinclude:: Parts/Vehicle.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Parts/Engine.php
|
|
||||||
|
|
||||||
.. literalinclude:: Parts/Engine.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Test
|
Test
|
||||||
----
|
----
|
||||||
|
|
||||||
|
@@ -28,15 +28,9 @@ Code
|
|||||||
|
|
||||||
You can also find these code on `GitHub`_
|
You can also find these code on `GitHub`_
|
||||||
|
|
||||||
Porsche.php
|
FactoryMethod.php
|
||||||
|
|
||||||
.. literalinclude:: Porsche.php
|
.. literalinclude:: FactoryMethod.php
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
GermanFactory.php
|
|
||||||
|
|
||||||
.. literalinclude:: GermanFactory.php
|
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
@@ -46,15 +40,21 @@ ItalianFactory.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
GermanFactory.php
|
||||||
|
|
||||||
|
.. literalinclude:: GermanFactory.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
VehicleInterface.php
|
VehicleInterface.php
|
||||||
|
|
||||||
.. literalinclude:: VehicleInterface.php
|
.. literalinclude:: VehicleInterface.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
FactoryMethod.php
|
Porsche.php
|
||||||
|
|
||||||
.. literalinclude:: FactoryMethod.php
|
.. literalinclude:: Porsche.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
@@ -54,17 +54,17 @@ Worker.php
|
|||||||
Test
|
Test
|
||||||
----
|
----
|
||||||
|
|
||||||
Tests/TestWorker.php
|
|
||||||
|
|
||||||
.. literalinclude:: Tests/TestWorker.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Tests/PoolTest.php
|
Tests/PoolTest.php
|
||||||
|
|
||||||
.. literalinclude:: Tests/PoolTest.php
|
.. literalinclude:: Tests/PoolTest.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
Tests/TestWorker.php
|
||||||
|
|
||||||
|
.. literalinclude:: Tests/TestWorker.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Pool
|
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Pool
|
||||||
.. _`Pool`: http://en.wikipedia.org/wiki/Object_pool_pattern
|
.. _`Pool`: http://en.wikipedia.org/wiki/Object_pool_pattern
|
||||||
|
@@ -25,6 +25,12 @@ Code
|
|||||||
|
|
||||||
You can also find these code on `GitHub`_
|
You can also find these code on `GitHub`_
|
||||||
|
|
||||||
|
index.php
|
||||||
|
|
||||||
|
.. literalinclude:: index.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
BookPrototype.php
|
BookPrototype.php
|
||||||
|
|
||||||
.. literalinclude:: BookPrototype.php
|
.. literalinclude:: BookPrototype.php
|
||||||
@@ -37,12 +43,6 @@ BarBookPrototype.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
index.php
|
|
||||||
|
|
||||||
.. literalinclude:: index.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
FooBookPrototype.php
|
FooBookPrototype.php
|
||||||
|
|
||||||
.. literalinclude:: FooBookPrototype.php
|
.. literalinclude:: FooBookPrototype.php
|
||||||
|
@@ -36,18 +36,18 @@ VehicleInterface.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
Scooter.php
|
|
||||||
|
|
||||||
.. literalinclude:: Scooter.php
|
|
||||||
:language: php
|
|
||||||
:linenos:
|
|
||||||
|
|
||||||
Bicycle.php
|
Bicycle.php
|
||||||
|
|
||||||
.. literalinclude:: Bicycle.php
|
.. literalinclude:: Bicycle.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
|
Scooter.php
|
||||||
|
|
||||||
|
.. literalinclude:: Scooter.php
|
||||||
|
:language: php
|
||||||
|
:linenos:
|
||||||
|
|
||||||
Test
|
Test
|
||||||
----
|
----
|
||||||
|
|
||||||
|
11
README.rst
11
README.rst
@@ -37,9 +37,7 @@ Contribute
|
|||||||
Please feel free to fork and extend existing or add your own examples
|
Please feel free to fork and extend existing or add your own examples
|
||||||
and send a pull request with your changes! To establish a consistent
|
and send a pull request with your changes! To establish a consistent
|
||||||
code quality, please check your code using
|
code quality, please check your code using
|
||||||
`PHP\_CodeSniffer <https://github.com/squizlabs/PHP_CodeSniffer>`__
|
`PHP CodeSniffer`_ against `PSR2 standard`_
|
||||||
against `PSR2
|
|
||||||
standard <https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md>`__
|
|
||||||
using ``./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor .``.
|
using ``./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor .``.
|
||||||
|
|
||||||
License
|
License
|
||||||
@@ -47,8 +45,7 @@ License
|
|||||||
|
|
||||||
(The MIT License)
|
(The MIT License)
|
||||||
|
|
||||||
Copyright (c) 2014 Dominik Liebler and
|
Copyright (c) 2014 `Dominik Liebler`_ and `contributors`_
|
||||||
`contributors <https://github.com/domnikl/DesignPatternsPHP/graphs/contributors>`__
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the
|
copy of this software and associated documentation files (the
|
||||||
@@ -70,3 +67,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
.. _`design patterns`: http://en.wikipedia.org/wiki/Software_design_pattern
|
.. _`design patterns`: http://en.wikipedia.org/wiki/Software_design_pattern
|
||||||
|
.. _`PHP CodeSniffer`: https://github.com/squizlabs/PHP_CodeSniffer
|
||||||
|
.. _`PSR2 standard`: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
|
||||||
|
.. _`Dominik Liebler`: https://github.com/domnikl
|
||||||
|
.. _`contributors`: https://github.com/domnikl/DesignPatternsPHP/graphs/contributors
|
||||||
|
Reference in New Issue
Block a user