1 <?php
declare(strict_types
=1);
3 require_once('common.php');
5 $taskMatrix = require 'taskMatrix.php';
6 $monday = turnBackTime(new DateTimeImmutable
);
8 $taskLists = array_merge(
9 isStartOfSeason($monday->month
, $monday->dayNum
) ?
[unlines(map(getString
)(getTasksForTheSeason($monday->season
, $taskMatrix)))] : [],
10 isStartOfMonth($monday->dayNum
) ?
[unlines(map(getString
)(getTasksForTheMonth($monday->month
, $taskMatrix)))] : [],
11 [unlines(map(getString
)(getTasksForTheWeek($monday->year
, $monday->month
, $monday->weekNum
, $taskMatrix)))]
15 [getString('happyMonday')],
17 [getString('beginningOf'. ucfirst(getMonthName($monday->month
))), getString('thisMonthThereAre', count(getTasksForTheMonth($monday->month
, $taskMatrix)))],
18 getString('anywayHeresTheWeek')
21 getString('beginningOf' . ucfirst($monday->season
)),
22 [getString('anywayHeresTheMonth'), getString('thisMonthThereAre', count(getTasksForTheMonth($monday->month
, $taskMatrix)))],
23 getString('finallyHeresTheWeek')
28 function($message, $list) {
31 is_array($message) ?
$message : [$message],
36 // Magic. startOfSeason implies startofMonth so we get 2, start of month without start of season gives 1 and
37 // a regular week (not the start of a season or month) gives 0. And this is how the indicies are ordered in the array.
38 $taskMessages[(int)isStartOfSeason($monday->month
, $monday->dayNum
) +
(int)isStartOfMonth($monday->dayNum
)],
42 foreach ($messages as $message) {
43 sendToGroupChat($message);