PHP7 TemplateMethod

This commit is contained in:
Dominik Liebler
2016-09-22 11:13:47 +02:00
parent 36f3df8fbb
commit 19fff0aed9
7 changed files with 734 additions and 360 deletions

View File

@@ -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";
}
}