mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-18 04:31:16 +02:00
PHP7 TemplateMethod
This commit is contained in:
@@ -2,16 +2,10 @@
|
||||
|
||||
namespace DesignPatterns\Behavioral\TemplateMethod;
|
||||
|
||||
/**
|
||||
* BeachJourney is vacation at the beach.
|
||||
*/
|
||||
class BeachJourney extends Journey
|
||||
{
|
||||
/**
|
||||
* prints what to do to enjoy your vacation.
|
||||
*/
|
||||
protected function enjoyVacation()
|
||||
protected function enjoyVacation(): string
|
||||
{
|
||||
echo "Swimming and sun-bathing\n";
|
||||
return "Swimming and sun-bathing";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user