mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 01:32:22 +01:00
make concrete journey
This commit is contained in:
parent
1569db1328
commit
1ab184fca7
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";
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user