From a836472602599dc1c316ca9b9ebe74309cb32517 Mon Sep 17 00:00:00 2001 From: Dominik Liebler Date: Thu, 12 Sep 2019 21:13:40 +0200 Subject: [PATCH] added missing files in READMEs --- Behavioral/Command/README.rst | 18 ++++++++++++++++++ Creational/Multiton/README.rst | 6 ++++++ More/ServiceLocator/README.rst | 6 ++++++ Structural/Proxy/README.rst | 6 ++++++ Structural/Registry/README.rst | 6 ++++++ check-refs-readmes | 7 ++++++- 6 files changed, 48 insertions(+), 1 deletion(-) diff --git a/Behavioral/Command/README.rst b/Behavioral/Command/README.rst index 0af4642..b51e56a 100644 --- a/Behavioral/Command/README.rst +++ b/Behavioral/Command/README.rst @@ -44,12 +44,24 @@ Command.php :language: php :linenos: +UndoableCommand.php + +.. literalinclude:: UndoableCommand.php + :language: php + :linenos: + HelloCommand.php .. literalinclude:: HelloCommand.php :language: php :linenos: +AddMessageDateCommand.php + +.. literalinclude:: AddMessageDateCommand.php + :language: php + :linenos: + Receiver.php .. literalinclude:: Receiver.php @@ -71,5 +83,11 @@ Tests/CommandTest.php :language: php :linenos: +Tests/UndoableCommandTest.php + +.. literalinclude:: Tests/UndoableCommandTest.php + :language: php + :linenos: + .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Behavioral/Command .. __: http://en.wikipedia.org/wiki/Command_pattern diff --git a/Creational/Multiton/README.rst b/Creational/Multiton/README.rst index 54d881a..bca627f 100644 --- a/Creational/Multiton/README.rst +++ b/Creational/Multiton/README.rst @@ -37,4 +37,10 @@ Multiton.php Test ---- +MultitonTest.php + +.. literalinclude:: Tests/MultitonTest.php + :language: php + :linenos: + .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Creational/Multiton diff --git a/More/ServiceLocator/README.rst b/More/ServiceLocator/README.rst index dcabc88..258b568 100644 --- a/More/ServiceLocator/README.rst +++ b/More/ServiceLocator/README.rst @@ -33,6 +33,12 @@ Code You can also find this code on `GitHub`_ +Service.php + +.. literalinclude:: Service.php + :language: php + :linenos: + ServiceLocator.php .. literalinclude:: ServiceLocator.php diff --git a/Structural/Proxy/README.rst b/Structural/Proxy/README.rst index 4b3e410..0080ed9 100644 --- a/Structural/Proxy/README.rst +++ b/Structural/Proxy/README.rst @@ -46,5 +46,11 @@ BankAccountProxy.php Test ---- +ProxyTest.php + +.. literalinclude:: Tests/ProxyTest.php + :language: php + :linenos: + .. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Structural/Proxy .. __: http://en.wikipedia.org/wiki/Proxy_pattern diff --git a/Structural/Registry/README.rst b/Structural/Registry/README.rst index f942322..975ab14 100644 --- a/Structural/Registry/README.rst +++ b/Structural/Registry/README.rst @@ -27,6 +27,12 @@ Registry.php :language: php :linenos: +Service.php + +.. literalinclude:: Service.php + :language: php + :linenos: + Test ---- diff --git a/check-refs-readmes b/check-refs-readmes index 4c6b4ec..5ce29d7 100755 --- a/check-refs-readmes +++ b/check-refs-readmes @@ -55,11 +55,16 @@ function getFilesFromReadmes() { $phpFiles = getFiles('/^.+\.php$/'); $filesFromReadme = getFilesFromReadmes(); $diff = array_diff($phpFiles, $filesFromReadme); +$diff2 = array_diff($filesFromReadme, $phpFiles); foreach ($diff as $file) { echo $file . PHP_EOL; } -if (count($diff) != 0) { +foreach ($diff2 as $file) { + echo $file . PHP_EOL; +} + +if (count($diff) != 0 || count($diff2) != 0) { exit(1); }