mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-30 19:50:12 +02:00
make concrete journey
This commit is contained in:
20
TemplateMethod/BeachJourney.php
Normal file
20
TemplateMethod/BeachJourney.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DesignPatternPHP
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace DesignPatterns\TemplateMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BeachJourney is vacation at the beach
|
||||||
|
*/
|
||||||
|
class BeachJourney extends Journey
|
||||||
|
{
|
||||||
|
|
||||||
|
protected function enjoyVacation()
|
||||||
|
{
|
||||||
|
echo "Swimming and sun-bathing\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
20
TemplateMethod/CityJouney.php
Normal file
20
TemplateMethod/CityJouney.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DesignPatternPHP
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace DesignPatterns\TemplateMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CityJouney is a journey in a city
|
||||||
|
*/
|
||||||
|
class CityJouney extends Journey
|
||||||
|
{
|
||||||
|
|
||||||
|
protected function enjoyVacation()
|
||||||
|
{
|
||||||
|
echo "Eat, drink, take photos and sleep\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user