sort php files Creational

This commit is contained in:
Faust
2015-04-07 22:00:12 +02:00
parent ff327e3a0c
commit 23abee8078
23 changed files with 100 additions and 99 deletions

View File

@@ -20,4 +20,4 @@ carrying out this communication.
State/README State/README
Strategy/README Strategy/README
TemplateMethod/README TemplateMethod/README
Visitor/README Visitor/README

View File

@@ -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
---- ----
@@ -91,4 +91,4 @@ Tests/AbstractFactoryTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/AbstractFactory .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/AbstractFactory
.. _`Abstract Factory`: http://en.wikipedia.org/wiki/Abstract_factory_pattern .. _`Abstract Factory`: http://en.wikipedia.org/wiki/Abstract_factory_pattern

View File

@@ -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
---- ----
@@ -102,4 +102,4 @@ Tests/DirectorTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Builder .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Builder
.. _`Builder`: http://en.wikipedia.org/wiki/Builder_pattern .. _`Builder`: http://en.wikipedia.org/wiki/Builder_pattern

View File

@@ -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:
@@ -80,4 +80,4 @@ Tests/FactoryMethodTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/FactoryMethod .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/FactoryMethod
.. _`Factory Method`: http://en.wikipedia.org/wiki/Factory_method_pattern .. _`Factory Method`: http://en.wikipedia.org/wiki/Factory_method_pattern

View File

@@ -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

View File

@@ -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
@@ -53,4 +53,4 @@ Test
---- ----
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Prototype .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Prototype
.. _`Prototype`: http://en.wikipedia.org/wiki/Prototype_pattern .. _`Prototype`: http://en.wikipedia.org/wiki/Prototype_pattern

View File

@@ -19,4 +19,4 @@ this object creation.
Prototype/README Prototype/README
SimpleFactory/README SimpleFactory/README
Singleton/README Singleton/README
StaticFactory/README StaticFactory/README

View File

@@ -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
---- ----

View File

@@ -47,4 +47,4 @@ Tests/SingletonTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Singleton .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Singleton
.. _`Singleton`: http://en.wikipedia.org/wiki/Singleton_pattern .. _`Singleton`: http://en.wikipedia.org/wiki/Singleton_pattern

View File

@@ -51,4 +51,4 @@ Tests/DelegationTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/Delegation .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/Delegation
.. _`Delegation`: http://en.wikipedia.org/wiki/Delegation_pattern .. _`Delegation`: http://en.wikipedia.org/wiki/Delegation_pattern

View File

@@ -6,4 +6,4 @@ More
Delegation/README Delegation/README
ServiceLocator/README ServiceLocator/README
Repository/README Repository/README

View File

@@ -81,4 +81,4 @@ Tests/ServiceLocatorTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/ServiceLocator .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/ServiceLocator
.. _`Service Locator`: http://en.wikipedia.org/wiki/Service_locator_pattern .. _`Service Locator`: http://en.wikipedia.org/wiki/Service_locator_pattern

View File

@@ -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

View File

@@ -68,4 +68,4 @@ Tests/AdapterTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Adapter .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Adapter
.. _`Adapter / Wrapper`: http://en.wikipedia.org/wiki/Adapter_pattern .. _`Adapter / Wrapper`: http://en.wikipedia.org/wiki/Adapter_pattern

View File

@@ -71,4 +71,4 @@ Tests/BridgeTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Bridge .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Bridge
.. _`Bridge`: http://en.wikipedia.org/wiki/Bridge_pattern .. _`Bridge`: http://en.wikipedia.org/wiki/Bridge_pattern

View File

@@ -62,4 +62,4 @@ Tests/CompositeTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Composite .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Composite
.. _`Composite`: http://en.wikipedia.org/wiki/Composite_pattern .. _`Composite`: http://en.wikipedia.org/wiki/Composite_pattern

View File

@@ -57,4 +57,4 @@ Tests/DataMapperTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/DataMapper .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/DataMapper
.. _`Data Mapper`: http://en.wikipedia.org/wiki/Data_mapper_pattern .. _`Data Mapper`: http://en.wikipedia.org/wiki/Data_mapper_pattern

View File

@@ -65,4 +65,4 @@ Tests/DecoratorTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Decorator .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Decorator
.. _`Decorator`: http://en.wikipedia.org/wiki/Decorator_pattern .. _`Decorator`: http://en.wikipedia.org/wiki/Decorator_pattern

View File

@@ -85,4 +85,4 @@ Tests/config.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/DependencyInjection .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/DependencyInjection
.. _`Dependency Injection`: http://en.wikipedia.org/wiki/Dependency_injection .. _`Dependency Injection`: http://en.wikipedia.org/wiki/Dependency_injection

View File

@@ -63,4 +63,4 @@ Tests/FacadeTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Facade .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Facade
.. _`Facade`: http://en.wikipedia.org/wiki/Facade_pattern .. _`Facade`: http://en.wikipedia.org/wiki/Facade_pattern

View File

@@ -41,4 +41,4 @@ Test
---- ----
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Proxy .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Proxy
.. _`Proxy`: http://en.wikipedia.org/wiki/Proxy_pattern .. _`Proxy`: http://en.wikipedia.org/wiki/Proxy_pattern

View File

@@ -17,4 +17,4 @@ relationships between entities.
Facade/README Facade/README
FluentInterface/README FluentInterface/README
Proxy/README Proxy/README
Registry/README Registry/README

View File

@@ -44,4 +44,4 @@ Tests/RegistryTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Registry .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Registry
.. _`Registry`: http://en.wikipedia.org/wiki/Service_locator_pattern .. _`Registry`: http://en.wikipedia.org/wiki/Service_locator_pattern