Skip to content
Snippets Groups Projects
Commit cccfa9c6 authored by Адлан Шамавов's avatar Адлан Шамавов
Browse files

Merge branch 'PTPS_Function_5' into PTPS_Function_6

parents 9be184f3 6cfdbf5a
No related branches found
No related tags found
1 merge request!6Ptps function 6
......@@ -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
......@@ -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 год, в котором необходимо произвести расчет
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment