From 109da771fbbd105b8e327f70ba48b3f2e583bd79 Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Mon, 7 Jan 2019 02:34:00 +0800 Subject: [PATCH] Random cleanup --- src/goodnight.php | 2 +- src/purjolok.php | 4 ++-- src/tasks.php | 2 +- src/unfinished.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/goodnight.php b/src/goodnight.php index f3ce616..e34a154 100644 --- a/src/goodnight.php +++ b/src/goodnight.php @@ -15,7 +15,7 @@ array_filter( ), function($forecast) { $forecastDayLocal = DateTimeImmutable::createFromMutable($forecast->time->from)->setTimezone(new DateTimeZone('Australia/Perth')); - return (int)(new DateTimeImmutable())->format('d') + 1 == (int)$forecastDayLocal->format('d'); + return (int)(new DateTimeImmutable)->format('d') + 1 == (int)$forecastDayLocal->format('d'); } ))); diff --git a/src/purjolok.php b/src/purjolok.php index dcc2eac..94cc011 100644 --- a/src/purjolok.php +++ b/src/purjolok.php @@ -16,7 +16,7 @@ if(getTelegram()->getWebHookUpdates()->get('message') && !canChatWith(getTelegra $message = getTelegram()->getWebHookUpdates()->get('message') ? getTelegram()->getWebHookUpdates()->get('message')->get('text') : ''; if ($between = between(reveal($message ?? ''), '[taskid]')) { - $monday = turnBackTime(new DateTimeImmutable()); + $monday = turnBackTime(new DateTimeImmutable); $completedTasksFile = getFilePathForWeek($monday->year, $monday->month, $monday->weekNum); $completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : []; $tasksForTheWeek = getTasksForTheWeek( @@ -225,7 +225,7 @@ getTelegram()->addCommand( protected $description = 'List tasks for this week'; public function handle($arguments) { - $monday = turnBackTime(new DateTimeImmutable()); + $monday = turnBackTime(new DateTimeImmutable); $tasksForTheWeek = getTasksForTheWeek( $monday->year, $monday->month, diff --git a/src/tasks.php b/src/tasks.php index 42c0f7c..94a8e37 100644 --- a/src/tasks.php +++ b/src/tasks.php @@ -3,7 +3,7 @@ require_once('common.php'); $taskMatrix = require 'taskMatrix.php'; -$monday = turnBackTime(new DateTimeImmutable()); +$monday = turnBackTime(new DateTimeImmutable); $taskLists = array_merge( isStartOfSeason($monday->month, $monday->dayNum) ? [unlines(map(getString)(getTasksForTheSeason($monday->season, $taskMatrix)))] : [], diff --git a/src/unfinished.php b/src/unfinished.php index 5e3a02c..890e0bf 100644 --- a/src/unfinished.php +++ b/src/unfinished.php @@ -3,7 +3,7 @@ require_once('common.php'); $taskMatrix = require 'taskMatrix.php'; -$monday = turnBackTime(new DateTimeImmutable()); +$monday = turnBackTime(new DateTimeImmutable); $extractTasks = function($tasks, $path) { return array_merge($tasks, file_exists($path) ? lines(trim(file_get_contents($path))) : []); -- 2.11.0