Skip to content

Files

Latest commit

6177545 · Nov 6, 2018

History

History
This branch is 340 commits behind DesignPatternsPHP/DesignPatternsPHP:main.

Bridge

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018
Nov 6, 2018

Purpose

Decouple an abstraction from its implementation so that the two can vary independently.

Examples

UML Diagram

Alt Bridge UML Diagram

Code

You can also find this code on GitHub

Formatter.php

.. literalinclude:: Formatter.php
   :language: php
   :linenos:

PlainTextFormatter.php

.. literalinclude:: PlainTextFormatter.php
   :language: php
   :linenos:

HtmlFormatter.php

.. literalinclude:: HtmlFormatter.php
   :language: php
   :linenos:

Service.php

.. literalinclude:: Service.php
   :language: php
   :linenos:

HelloWorldService.php

.. literalinclude:: HelloWorldService.php
   :language: php
   :linenos:

PingService.php

.. literalinclude:: PingService.php
   :language: php
   :linenos:

Test

Tests/BridgeTest.php

.. literalinclude:: Tests/BridgeTest.php
   :language: php
   :linenos: