Skip to content

Instantly share code, notes, and snippets.

@MarionLeHerisson
Last active March 10, 2020 15:23
Show Gist options
  • Save MarionLeHerisson/021e64866630ed2a81a719f2d8c8865c to your computer and use it in GitHub Desktop.
Save MarionLeHerisson/021e64866630ed2a81a719f2d8c8865c to your computer and use it in GitHub Desktop.
Soft. Arch. Heuristics - Exercice 3 : smart Hello World
/** @Route("helloworld-{name} */
public function helloWorldAction($name)
{
$now = date('H');
if ($now >= 6 && $now < 12) {
die('Good morning ' . $name . '!');
}
else if ($now >= 12 && $now < 20) {
die ('Good afternoon ' . $name . '!');
}
die ('Good night ' . $name . '!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment