mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-21 08:02:34 +01:00
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:
parent
b98f3436ab
commit
f862fba24e
@ -43,11 +43,11 @@ Bicycle.php
|
||||
Usage
|
||||
-----
|
||||
|
||||
.. code:: php
|
||||
Usage/SimpleFactoryUsage.php
|
||||
|
||||
$factory = new SimpleFactory();
|
||||
$bicycle = $factory->createBicycle();
|
||||
$bicycle->driveTo('Paris');
|
||||
.. literalinclude:: Usage/SimpleFactoryUsage.php
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
Test
|
||||
----
|
||||
|
9
Creational/SimpleFactory/Usage/SimpleFactoryUsage.php
Normal file
9
Creational/SimpleFactory/Usage/SimpleFactoryUsage.php
Normal 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');
|
Loading…
x
Reference in New Issue
Block a user