Init RTD v2 config

This commit is contained in:
borislavsabev
2023-09-20 15:49:24 +03:00
parent d9439e3650
commit b8aa050a73
43 changed files with 63 additions and 47 deletions

13
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,13 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python:
install:
- requirements: requirements.txt
sphinx:
configuration: conf.py
fail_on_warning: false

View File

@@ -56,5 +56,5 @@ Tests/ChainTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/ChainOfResponsibilities .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/ChainOfResponsibilities
.. __: http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern .. __: http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern

View File

@@ -89,5 +89,5 @@ Tests/UndoableCommandTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Command .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Command
.. __: http://en.wikipedia.org/wiki/Command_pattern .. __: http://en.wikipedia.org/wiki/Command_pattern

View File

@@ -67,5 +67,5 @@ Tests/InterpreterTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Interpreter .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Interpreter
.. __: https://en.wikipedia.org/wiki/Interpreter_pattern .. __: https://en.wikipedia.org/wiki/Interpreter_pattern

View File

@@ -53,5 +53,5 @@ Tests/IteratorTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Iterator .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Iterator
.. __: http://en.wikipedia.org/wiki/Iterator_pattern .. __: http://en.wikipedia.org/wiki/Iterator_pattern

View File

@@ -63,5 +63,5 @@ Tests/MediatorTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Mediator .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Mediator
.. __: http://en.wikipedia.org/wiki/Mediator_pattern .. __: http://en.wikipedia.org/wiki/Mediator_pattern

View File

@@ -81,5 +81,5 @@ Tests/MementoTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Memento .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Memento
.. __: http://en.wikipedia.org/wiki/Memento_pattern .. __: http://en.wikipedia.org/wiki/Memento_pattern

View File

@@ -70,5 +70,5 @@ Tests/LoggerTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/NullObject .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/NullObject
.. __: http://en.wikipedia.org/wiki/Null_Object_pattern .. __: http://en.wikipedia.org/wiki/Null_Object_pattern

View File

@@ -54,5 +54,5 @@ Tests/ObserverTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Observer .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Observer
.. __: http://en.wikipedia.org/wiki/Observer_pattern .. __: http://en.wikipedia.org/wiki/Observer_pattern

View File

@@ -71,5 +71,5 @@ Tests/SpecificationTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Specification .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Specification
.. __: http://en.wikipedia.org/wiki/Specification_pattern .. __: http://en.wikipedia.org/wiki/Specification_pattern

View File

@@ -60,5 +60,5 @@ Tests/StateTest.php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/State .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/State
.. __: http://en.wikipedia.org/wiki/State_pattern .. __: http://en.wikipedia.org/wiki/State_pattern

View File

@@ -67,5 +67,5 @@ Tests/StrategyTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Strategy .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Strategy
.. __: http://en.wikipedia.org/wiki/Strategy_pattern .. __: http://en.wikipedia.org/wiki/Strategy_pattern

View File

@@ -60,5 +60,5 @@ Tests/JourneyTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/TemplateMethod .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/TemplateMethod
.. __: http://en.wikipedia.org/wiki/Template_method_pattern .. __: http://en.wikipedia.org/wiki/Template_method_pattern

View File

@@ -64,5 +64,5 @@ Tests/VisitorTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Behavioral/Visitor .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/Visitor
.. __: http://en.wikipedia.org/wiki/Visitor_pattern .. __: http://en.wikipedia.org/wiki/Visitor_pattern

View File

@@ -84,5 +84,5 @@ Tests/AbstractFactoryTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/AbstractFactory .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/AbstractFactory
.. __: http://en.wikipedia.org/wiki/Abstract_factory_pattern .. __: http://en.wikipedia.org/wiki/Abstract_factory_pattern

View File

@@ -101,5 +101,5 @@ Tests/DirectorTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/Builder .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/Builder
.. __: http://en.wikipedia.org/wiki/Builder_pattern .. __: http://en.wikipedia.org/wiki/Builder_pattern

View File

@@ -73,5 +73,5 @@ Tests/FactoryMethodTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/FactoryMethod .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/FactoryMethod
.. __: http://en.wikipedia.org/wiki/Factory_method_pattern .. __: http://en.wikipedia.org/wiki/Factory_method_pattern

View File

@@ -57,5 +57,5 @@ Tests/PoolTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/Pool .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/Pool
.. __: http://en.wikipedia.org/wiki/Object_pool_pattern .. __: http://en.wikipedia.org/wiki/Object_pool_pattern

View File

@@ -52,5 +52,5 @@ Tests/PrototypeTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/Prototype .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/Prototype
.. __: http://en.wikipedia.org/wiki/Prototype_pattern .. __: http://en.wikipedia.org/wiki/Prototype_pattern

View File

@@ -53,4 +53,4 @@ Tests/SimpleFactoryTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/SimpleFactory .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/SimpleFactory

View File

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

View File

@@ -55,4 +55,4 @@ Tests/StaticFactoryTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Creational/StaticFactory .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/StaticFactory

View File

@@ -50,5 +50,5 @@ Tests/EAVTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/More/EAV .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/More/EAV
.. __: https://en.wikipedia.org/wiki/Entityattributevalue_model .. __: https://en.wikipedia.org/wiki/Entityattributevalue_model

View File

@@ -76,4 +76,4 @@ Tests/PostRepositoryTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/More/Repository .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/More/Repository

View File

@@ -60,5 +60,5 @@ Tests/ServiceLocatorTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/More/ServiceLocator .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/More/ServiceLocator
.. __: http://en.wikipedia.org/wiki/Service_locator_pattern .. __: http://en.wikipedia.org/wiki/Service_locator_pattern

View File

@@ -1,6 +1,6 @@
# DesignPatternsPHP # DesignPatternsPHP
[![Build Status](https://github.com/domnikl/DesignPatternsPHP/workflows/CI/badge.svg)](https://github.com/domnikl/DesignPatternsPHP/actions) [![Build Status](https://github.com/DesignPatternsPHP/DesignPatternsPHP/workflows/CI/badge.svg)](https://github.com/DesignPatternsPHP/DesignPatternsPHP/actions)
Note from the maintainers: Note from the maintainers:
> The project's ReadTheDocs pages is currently down and are being reconfigured. We're sorry for any inconvenience please read through the repository directly on github. > The project's ReadTheDocs pages is currently down and are being reconfigured. We're sorry for any inconvenience please read through the repository directly on github.

View File

@@ -67,5 +67,5 @@ Tests/AdapterTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Adapter .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Adapter
.. __: http://en.wikipedia.org/wiki/Adapter_pattern .. __: http://en.wikipedia.org/wiki/Adapter_pattern

View File

@@ -64,5 +64,5 @@ Tests/BridgeTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Bridge .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Bridge
.. __: http://en.wikipedia.org/wiki/Bridge_pattern .. __: http://en.wikipedia.org/wiki/Bridge_pattern

View File

@@ -59,5 +59,5 @@ Tests/CompositeTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Composite .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Composite
.. __: http://en.wikipedia.org/wiki/Composite_pattern .. __: http://en.wikipedia.org/wiki/Composite_pattern

View File

@@ -62,5 +62,5 @@ Tests/DataMapperTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/DataMapper .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/DataMapper
.. __: http://en.wikipedia.org/wiki/Data_mapper_pattern .. __: http://en.wikipedia.org/wiki/Data_mapper_pattern

View File

@@ -14,7 +14,7 @@ class DataMapperTest extends TestCase
{ {
public function testCanMapUserFromStorage() public function testCanMapUserFromStorage()
{ {
$storage = new StorageAdapter([1 => ['username' => 'domnikl', 'email' => 'liebler.dominik@gmail.com']]); $storage = new StorageAdapter([1 => ['username' => 'someone', 'email' => 'someone@example.com']]);
$mapper = new UserMapper($storage); $mapper = new UserMapper($storage);
$user = $mapper->findById(1); $user = $mapper->findById(1);

View File

@@ -63,5 +63,5 @@ Tests/DecoratorTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Decorator .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Decorator
.. __: http://en.wikipedia.org/wiki/Decorator_pattern .. __: http://en.wikipedia.org/wiki/Decorator_pattern

View File

@@ -59,5 +59,5 @@ Tests/DependencyInjectionTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/DependencyInjection .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/DependencyInjection
.. __: http://en.wikipedia.org/wiki/Dependency_injection .. __: http://en.wikipedia.org/wiki/Dependency_injection

View File

@@ -12,9 +12,9 @@ class DependencyInjectionTest extends TestCase
{ {
public function testDependencyInjection() public function testDependencyInjection()
{ {
$config = new DatabaseConfiguration('localhost', 3306, 'domnikl', '1234'); $config = new DatabaseConfiguration('localhost', 3306, 'user', '1234');
$connection = new DatabaseConnection($config); $connection = new DatabaseConnection($config);
$this->assertSame('domnikl:1234@localhost:3306', $connection->getDsn()); $this->assertSame('user:1234@localhost:3306', $connection->getDsn());
} }
} }

View File

@@ -62,5 +62,5 @@ Tests/FacadeTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Facade .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Facade
.. __: http://en.wikipedia.org/wiki/Facade_pattern .. __: http://en.wikipedia.org/wiki/Facade_pattern

View File

@@ -41,5 +41,5 @@ Tests/FluentInterfaceTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/FluentInterface .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/FluentInterface
.. __: http://en.wikipedia.org/wiki/Fluent_interface .. __: http://en.wikipedia.org/wiki/Fluent_interface

View File

@@ -53,5 +53,5 @@ Tests/FlyweightTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Flyweight .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Flyweight
.. __: https://en.wikipedia.org/wiki/Flyweight_pattern .. __: https://en.wikipedia.org/wiki/Flyweight_pattern

View File

@@ -52,5 +52,5 @@ ProxyTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Proxy .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Proxy
.. __: http://en.wikipedia.org/wiki/Proxy_pattern .. __: http://en.wikipedia.org/wiki/Proxy_pattern

View File

@@ -42,5 +42,5 @@ Tests/RegistryTest.php
:language: php :language: php
:linenos: :linenos:
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/main/Structural/Registry .. _`GitHub`: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Structural/Registry
.. __: http://en.wikipedia.org/wiki/Service_locator_pattern .. __: http://en.wikipedia.org/wiki/Service_locator_pattern

View File

@@ -6,6 +6,10 @@
{ {
"name": "Dominik Liebler", "name": "Dominik Liebler",
"email": "liebler.dominik@googlemail.com" "email": "liebler.dominik@googlemail.com"
},
{
"name": "Borislav Sabev",
"email": "39cn9aod@mailer.me"
} }
], ],
"minimum-stability": "stable", "minimum-stability": "stable",

View File

@@ -43,7 +43,7 @@ source_suffix = '.rst'
#source_encoding = 'utf-8-sig' #source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = 'README' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'DesignPatternsPHP' project = u'DesignPatternsPHP'
@@ -64,7 +64,7 @@ release = '1.0'
# #
# This is also used if you do content translation via gettext catalogs. # This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases. # Usually you set "language" from the command line for these cases.
language = None language = 'en'
# There are two options for replacing |today|: either, you set today to some # There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used: # non-false value, then it is used:

View File

@@ -8,18 +8,14 @@
DesignPatternsPHP DesignPatternsPHP
================= =================
.. image:: https://github.com/domnikl/DesignPatternsPHP/workflows/CI/badge.svg .. image:: https://github.com/DesignPatternsPHP/DesignPatternsPHP/workflows/CI/badge.svg
:target: https://github.com/domnikl/DesignPatternsPHP/actions :target: https://github.com/DesignPatternsPHP/DesignPatternsPHP/actions
:alt: Build Status :alt: Build Status
.. image:: https://readthedocs.org/projects/designpatternsphp/badge/?version=latest .. image:: https://readthedocs.org/projects/designpatternsphp/badge/?version=latest
:target: https://readthedocs.org/projects/designpatternsphp/?badge=latest :target: https://readthedocs.org/projects/designpatternsphp/?badge=latest
:alt: Documentation Status :alt: Documentation Status
.. image:: https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square
:target: https://paypal.me/DominikLiebler
:alt: Donate
This is a collection of known design patterns and some sample code how This is a collection of known design patterns and some sample code how
to implement them in PHP. Every pattern has a small list of examples. to implement them in PHP. Every pattern has a small list of examples.

3
requirements.txt Normal file
View File

@@ -0,0 +1,3 @@
sphinx
sphinx_rtd_theme
readthedocs-sphinx-search