Creational/Singleton/README.rst
Singleton__THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND MAINTAINABILITY USE DEPENDENCY INJECTION!
To have only one instance of this object in the application that will handle all calls.
.. image:: uml/uml.png :alt: Alt Singleton UML Diagram :align: center
You can also find this code on GitHub_
Singleton.php
.. literalinclude:: Singleton.php :language: php :linenos:
Tests/SingletonTest.php
.. literalinclude:: Tests/SingletonTest.php :language: php :linenos:
.. _GitHub: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Creational/Singleton
.. __: http://en.wikipedia.org/wiki/Singleton_pattern