mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-09 09:34:46 +02: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:
@ -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
|
||||||
----
|
----
|
||||||
|
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');
|
Reference in New Issue
Block a user