Move usage code exaple to single file and correctly include it

This make code more structured and fix code highlighting problem
This commit is contained in:
Nikita Strelkov
2016-10-03 06:25:33 +05:00
parent b98f3436ab
commit f862fba24e
2 changed files with 13 additions and 4 deletions

View File

@ -43,11 +43,11 @@ Bicycle.php
Usage Usage
----- -----
.. code:: php Usage/SimpleFactoryUsage.php
$factory = new SimpleFactory(); .. literalinclude:: Usage/SimpleFactoryUsage.php
$bicycle = $factory->createBicycle(); :language: php
$bicycle->driveTo('Paris'); :linenos:
Test Test
---- ----

View File

@ -0,0 +1,9 @@
<?php
namespace DesignPatterns\Creational\SimpleFactory\Usage;
use DesignPatterns\Creational\SimpleFactory\SimpleFactory;
$factory = new SimpleFactory();
$bicycle = $factory->createBicycle();
$bicycle->driveTo('Paris');