diff --git a/index.php b/index.php index 35b3e35c527dda13ec0db081d35a5f7bf7726a46..4573d8d9868f489c6e410e4b02854700dbe1536e 100644 --- a/index.php +++ b/index.php @@ -71,7 +71,8 @@ ]; print_r($func->prepareMenu($aMenu)); ?> - + + <h1>Function 5</h1> <?php print "<h2>До ÐГ: </h2>"; @@ -82,17 +83,16 @@ } ?> - -<h1>Function 6</h1> + <h1>Function 6</h1> <?php print "<h2>ПÑтницы 13: </h2>"; - try { - foreach ($func->countFriday13(2024) as $date) { - print $date->format("Y-m-d l") . "\n"; + try { + foreach ($func->countFriday13(2024) as $date) { + print $date->format("Y-m-d l") . "\n"; + } + } catch (Exception $e) { + print $e->getMessage(); } - } catch (Exception $e) { - print $e->getMessage(); - } ?> </body> </html> \ No newline at end of file diff --git a/src/Functions.php b/src/Functions.php index a78ddd59e93d6e408b2c09edc09d1d7a2afe9808..f7b52aa43644e535ee393f3fc3973a396378c55e 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -4,19 +4,13 @@ declare(strict_types=1); namespace Hp\Test; -use DateTimeImmutable; -use DateTime; -use DateInterval; -use DatePeriod; -use Exception; - class Functions { /** - * ВыполнÑет Ñортировку маÑÑива по убыванию цены - * @param array $array - * @return array - */ + * ВыполнÑет Ñортировку маÑÑива по убыванию цены + * @param array $array + * @return array + */ public function sortPrice(array $array): array { @@ -143,7 +137,7 @@ class Functions * ['name' => 'ПоÑуда','depth' => 1,],]], * ]; */ - + /** * Ð¤ÑƒÐ½ÐºÑ†Ð¸Ñ Ñ€Ð°ÑÑчитывает кол-во дней до нового года * @param DateTimeImmutable $date дата от которой, необходимо раÑÑчитать кол-во дней @@ -158,7 +152,6 @@ class Functions return (int)$dateInterval->format("%a") + 1; } - /** * Вернет вÑе пÑтницы 13 в году * @param int $year год, в котором необходимо произвеÑти раÑчет