From 266a484089618bbbcfffb379b07c5c929e187f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=AE=D0=B4?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Mon, 21 Mar 2022 06:26:43 +0300 Subject: [PATCH] example update --- examples/aliases.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/examples/aliases.php b/examples/aliases.php index 351d8cb..44e1f63 100644 --- a/examples/aliases.php +++ b/examples/aliases.php @@ -5,26 +5,24 @@ use isDayOff\Client\IsDayOff; $client = new IsDayOff(); -$date = new DateTime(); -$tomorrow = clone $date; -$tomorrow->modify('+1 day'); + +// Tomorrow example +$tomorrowDate = new DateTime(); +$tomorrowDate->modify('+1 day'); $result = $client->date()->tomorrow(); -if($result) -{ - echo $tomorrow->format('Y-m-d') . ' is day off.' . PHP_EOL; -} -else -{ - echo $tomorrow->format('Y-m-d') . ' working day.' . PHP_EOL; +if($result) { + echo $tomorrowDate->format('Y-m-d') . ' is day off.' . PHP_EOL; +} else { + echo $tomorrowDate->format('Y-m-d') . ' working day.' . PHP_EOL; } +// Today example +$todayDate = new DateTime(); $result = $client->date()->today(); -if($result) -{ - echo $date->format('Y-m-d') . ' is day off.' . PHP_EOL; -} -else -{ - echo $date->format('Y-m-d') . ' working day.' . PHP_EOL; + +if($result) { + echo $todayDate->format('Y-m-d') . ' is day off.' . PHP_EOL; +} else { + echo $todayDate->format('Y-m-d') . ' working day.' . PHP_EOL; } \ No newline at end of file