diff --git a/Behavioral/README.rst b/Behavioral/README.rst index afd911c..646df1f 100644 --- a/Behavioral/README.rst +++ b/Behavioral/README.rst @@ -20,4 +20,4 @@ carrying out this communication. State/README Strategy/README TemplateMethod/README - Visitor/README \ No newline at end of file + Visitor/README diff --git a/Creational/AbstractFactory/README.rst b/Creational/AbstractFactory/README.rst index 9942e4c..3e6d7ef 100644 --- a/Creational/AbstractFactory/README.rst +++ b/Creational/AbstractFactory/README.rst @@ -21,9 +21,9 @@ Code You can also find these code on `GitHub`_ -Text.php +AbstractFactory.php -.. literalinclude:: Text.php +.. literalinclude:: AbstractFactory.php :language: php :linenos: @@ -33,9 +33,9 @@ JsonFactory.php :language: php :linenos: -AbstractFactory.php +HtmlFactory.php -.. literalinclude:: AbstractFactory.php +.. literalinclude:: HtmlFactory.php :language: php :linenos: @@ -45,27 +45,15 @@ MediaInterface.php :language: php :linenos: -HtmlFactory.php - -.. literalinclude:: HtmlFactory.php - :language: php - :linenos: - Picture.php .. literalinclude:: Picture.php :language: php :linenos: -Html/Picture.php +Text.php -.. literalinclude:: Html/Picture.php - :language: php - :linenos: - -Html/Text.php - -.. literalinclude:: Html/Text.php +.. literalinclude:: Text.php :language: php :linenos: @@ -81,6 +69,18 @@ Json/Text.php :language: php :linenos: +Html/Picture.php + +.. literalinclude:: Html/Picture.php + :language: php + :linenos: + +Html/Text.php + +.. literalinclude:: Html/Text.php + :language: php + :linenos: + Test ---- @@ -91,4 +91,4 @@ Tests/AbstractFactoryTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/AbstractFactory -.. _`Abstract Factory`: http://en.wikipedia.org/wiki/Abstract_factory_pattern \ No newline at end of file +.. _`Abstract Factory`: http://en.wikipedia.org/wiki/Abstract_factory_pattern diff --git a/Creational/Builder/README.rst b/Creational/Builder/README.rst index 03a1030..85b38ea 100644 --- a/Creational/Builder/README.rst +++ b/Creational/Builder/README.rst @@ -32,27 +32,51 @@ Code You can also find these code on `GitHub`_ +Director.php + +.. literalinclude:: Director.php + :language: php + :linenos: + BuilderInterface.php .. literalinclude:: BuilderInterface.php :language: php :linenos: +BikeBuilder.php + +.. literalinclude:: BikeBuilder.php + :language: php + :linenos: + CarBuilder.php .. literalinclude:: CarBuilder.php :language: php :linenos: -Director.php +Parts/Vehicle.php -.. literalinclude:: Director.php +.. literalinclude:: Parts/Vehicle.php :language: php :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 :linenos: @@ -68,30 +92,6 @@ Parts/Door.php :language: php :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 ---- @@ -102,4 +102,4 @@ Tests/DirectorTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Builder -.. _`Builder`: http://en.wikipedia.org/wiki/Builder_pattern \ No newline at end of file +.. _`Builder`: http://en.wikipedia.org/wiki/Builder_pattern diff --git a/Creational/FactoryMethod/README.rst b/Creational/FactoryMethod/README.rst index 7552078..6ec224e 100644 --- a/Creational/FactoryMethod/README.rst +++ b/Creational/FactoryMethod/README.rst @@ -28,15 +28,9 @@ Code You can also find these code on `GitHub`_ -Porsche.php +FactoryMethod.php -.. literalinclude:: Porsche.php - :language: php - :linenos: - -GermanFactory.php - -.. literalinclude:: GermanFactory.php +.. literalinclude:: FactoryMethod.php :language: php :linenos: @@ -46,15 +40,21 @@ ItalianFactory.php :language: php :linenos: +GermanFactory.php + +.. literalinclude:: GermanFactory.php + :language: php + :linenos: + VehicleInterface.php .. literalinclude:: VehicleInterface.php :language: php :linenos: -FactoryMethod.php +Porsche.php -.. literalinclude:: FactoryMethod.php +.. literalinclude:: Porsche.php :language: php :linenos: @@ -80,4 +80,4 @@ Tests/FactoryMethodTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/FactoryMethod -.. _`Factory Method`: http://en.wikipedia.org/wiki/Factory_method_pattern \ No newline at end of file +.. _`Factory Method`: http://en.wikipedia.org/wiki/Factory_method_pattern diff --git a/Creational/Pool/README.rst b/Creational/Pool/README.rst index 6912c72..260d3b0 100644 --- a/Creational/Pool/README.rst +++ b/Creational/Pool/README.rst @@ -54,17 +54,17 @@ Worker.php Test ---- -Tests/TestWorker.php - -.. literalinclude:: Tests/TestWorker.php - :language: php - :linenos: - Tests/PoolTest.php .. literalinclude:: Tests/PoolTest.php :language: php :linenos: +Tests/TestWorker.php + +.. literalinclude:: Tests/TestWorker.php + :language: php + :linenos: + .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Pool .. _`Pool`: http://en.wikipedia.org/wiki/Object_pool_pattern diff --git a/Creational/Prototype/README.rst b/Creational/Prototype/README.rst index 5485edd..64c558d 100644 --- a/Creational/Prototype/README.rst +++ b/Creational/Prototype/README.rst @@ -25,6 +25,12 @@ Code You can also find these code on `GitHub`_ +index.php + +.. literalinclude:: index.php + :language: php + :linenos: + BookPrototype.php .. literalinclude:: BookPrototype.php @@ -37,12 +43,6 @@ BarBookPrototype.php :language: php :linenos: -index.php - -.. literalinclude:: index.php - :language: php - :linenos: - FooBookPrototype.php .. literalinclude:: FooBookPrototype.php @@ -53,4 +53,4 @@ Test ---- .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Prototype -.. _`Prototype`: http://en.wikipedia.org/wiki/Prototype_pattern \ No newline at end of file +.. _`Prototype`: http://en.wikipedia.org/wiki/Prototype_pattern diff --git a/Creational/README.rst b/Creational/README.rst index 72eb5d3..d908772 100644 --- a/Creational/README.rst +++ b/Creational/README.rst @@ -19,4 +19,4 @@ this object creation. Prototype/README SimpleFactory/README Singleton/README - StaticFactory/README \ No newline at end of file + StaticFactory/README diff --git a/Creational/SimpleFactory/README.rst b/Creational/SimpleFactory/README.rst index ff55711..364947f 100644 --- a/Creational/SimpleFactory/README.rst +++ b/Creational/SimpleFactory/README.rst @@ -36,18 +36,18 @@ VehicleInterface.php :language: php :linenos: -Scooter.php - -.. literalinclude:: Scooter.php - :language: php - :linenos: - Bicycle.php .. literalinclude:: Bicycle.php :language: php :linenos: +Scooter.php + +.. literalinclude:: Scooter.php + :language: php + :linenos: + Test ---- diff --git a/Creational/Singleton/README.rst b/Creational/Singleton/README.rst index 319364e..4ec37ae 100644 --- a/Creational/Singleton/README.rst +++ b/Creational/Singleton/README.rst @@ -47,4 +47,4 @@ Tests/SingletonTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Singleton -.. _`Singleton`: http://en.wikipedia.org/wiki/Singleton_pattern \ No newline at end of file +.. _`Singleton`: http://en.wikipedia.org/wiki/Singleton_pattern diff --git a/More/Delegation/README.rst b/More/Delegation/README.rst index 149cddf..51b05fc 100644 --- a/More/Delegation/README.rst +++ b/More/Delegation/README.rst @@ -51,4 +51,4 @@ Tests/DelegationTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/Delegation -.. _`Delegation`: http://en.wikipedia.org/wiki/Delegation_pattern \ No newline at end of file +.. _`Delegation`: http://en.wikipedia.org/wiki/Delegation_pattern diff --git a/More/README.rst b/More/README.rst index b0550f2..dbab1f6 100644 --- a/More/README.rst +++ b/More/README.rst @@ -6,4 +6,4 @@ More Delegation/README ServiceLocator/README - Repository/README \ No newline at end of file + Repository/README diff --git a/More/ServiceLocator/README.rst b/More/ServiceLocator/README.rst index 2972391..f7e69a2 100644 --- a/More/ServiceLocator/README.rst +++ b/More/ServiceLocator/README.rst @@ -81,4 +81,4 @@ Tests/ServiceLocatorTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/More/ServiceLocator -.. _`Service Locator`: http://en.wikipedia.org/wiki/Service_locator_pattern \ No newline at end of file +.. _`Service Locator`: http://en.wikipedia.org/wiki/Service_locator_pattern diff --git a/README.rst b/README.rst index cf83385..3db54a9 100644 --- a/README.rst +++ b/README.rst @@ -37,9 +37,7 @@ Contribute 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 code quality, please check your code using -`PHP\_CodeSniffer `__ -against `PSR2 -standard `__ +`PHP CodeSniffer`_ against `PSR2 standard`_ using ``./vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor .``. License @@ -47,8 +45,7 @@ License (The MIT License) -Copyright (c) 2014 Dominik Liebler and -`contributors `__ +Copyright (c) 2014 `Dominik Liebler`_ and `contributors`_ Permission is hereby granted, free of charge, to any person obtaining a 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. .. _`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 diff --git a/Structural/Adapter/README.rst b/Structural/Adapter/README.rst index 2aa2ea5..5136d07 100644 --- a/Structural/Adapter/README.rst +++ b/Structural/Adapter/README.rst @@ -68,4 +68,4 @@ Tests/AdapterTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Adapter -.. _`Adapter / Wrapper`: http://en.wikipedia.org/wiki/Adapter_pattern \ No newline at end of file +.. _`Adapter / Wrapper`: http://en.wikipedia.org/wiki/Adapter_pattern diff --git a/Structural/Bridge/README.rst b/Structural/Bridge/README.rst index 62b8056..1de59d8 100644 --- a/Structural/Bridge/README.rst +++ b/Structural/Bridge/README.rst @@ -71,4 +71,4 @@ Tests/BridgeTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Bridge -.. _`Bridge`: http://en.wikipedia.org/wiki/Bridge_pattern \ No newline at end of file +.. _`Bridge`: http://en.wikipedia.org/wiki/Bridge_pattern diff --git a/Structural/Composite/README.rst b/Structural/Composite/README.rst index 6c4af7d..432647e 100644 --- a/Structural/Composite/README.rst +++ b/Structural/Composite/README.rst @@ -62,4 +62,4 @@ Tests/CompositeTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Composite -.. _`Composite`: http://en.wikipedia.org/wiki/Composite_pattern \ No newline at end of file +.. _`Composite`: http://en.wikipedia.org/wiki/Composite_pattern diff --git a/Structural/DataMapper/README.rst b/Structural/DataMapper/README.rst index dcc24de..83ba501 100644 --- a/Structural/DataMapper/README.rst +++ b/Structural/DataMapper/README.rst @@ -57,4 +57,4 @@ Tests/DataMapperTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/DataMapper -.. _`Data Mapper`: http://en.wikipedia.org/wiki/Data_mapper_pattern \ No newline at end of file +.. _`Data Mapper`: http://en.wikipedia.org/wiki/Data_mapper_pattern diff --git a/Structural/Decorator/README.rst b/Structural/Decorator/README.rst index cb9d92b..95d234c 100644 --- a/Structural/Decorator/README.rst +++ b/Structural/Decorator/README.rst @@ -65,4 +65,4 @@ Tests/DecoratorTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Decorator -.. _`Decorator`: http://en.wikipedia.org/wiki/Decorator_pattern \ No newline at end of file +.. _`Decorator`: http://en.wikipedia.org/wiki/Decorator_pattern diff --git a/Structural/DependencyInjection/README.rst b/Structural/DependencyInjection/README.rst index bc7ddff..8200cc1 100644 --- a/Structural/DependencyInjection/README.rst +++ b/Structural/DependencyInjection/README.rst @@ -85,4 +85,4 @@ Tests/config.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/DependencyInjection -.. _`Dependency Injection`: http://en.wikipedia.org/wiki/Dependency_injection \ No newline at end of file +.. _`Dependency Injection`: http://en.wikipedia.org/wiki/Dependency_injection diff --git a/Structural/Facade/README.rst b/Structural/Facade/README.rst index e2baeca..5be63e7 100644 --- a/Structural/Facade/README.rst +++ b/Structural/Facade/README.rst @@ -63,4 +63,4 @@ Tests/FacadeTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Facade -.. _`Facade`: http://en.wikipedia.org/wiki/Facade_pattern \ No newline at end of file +.. _`Facade`: http://en.wikipedia.org/wiki/Facade_pattern diff --git a/Structural/Proxy/README.rst b/Structural/Proxy/README.rst index 4ff818e..f9aa24e 100644 --- a/Structural/Proxy/README.rst +++ b/Structural/Proxy/README.rst @@ -41,4 +41,4 @@ Test ---- .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Proxy -.. _`Proxy`: http://en.wikipedia.org/wiki/Proxy_pattern \ No newline at end of file +.. _`Proxy`: http://en.wikipedia.org/wiki/Proxy_pattern diff --git a/Structural/README.rst b/Structural/README.rst index 47b6650..f717b4a 100644 --- a/Structural/README.rst +++ b/Structural/README.rst @@ -17,4 +17,4 @@ relationships between entities. Facade/README FluentInterface/README Proxy/README - Registry/README \ No newline at end of file + Registry/README diff --git a/Structural/Registry/README.rst b/Structural/Registry/README.rst index f09bd2f..e95ed26 100644 --- a/Structural/Registry/README.rst +++ b/Structural/Registry/README.rst @@ -44,4 +44,4 @@ Tests/RegistryTest.php :linenos: .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Registry -.. _`Registry`: http://en.wikipedia.org/wiki/Service_locator_pattern \ No newline at end of file +.. _`Registry`: http://en.wikipedia.org/wiki/Service_locator_pattern