diff --git a/public/public/Actions/HowDaysToNYAction.php b/public/public/Actions/HowDaysToNYAction.php new file mode 100644 index 0000000000000000000000000000000000000000..9d71a5af56cf0359dfb3faec9b82a70b38613856 --- /dev/null +++ b/public/public/Actions/HowDaysToNYAction.php @@ -0,0 +1,20 @@ +modify('first day of Jan +1 year'); + + return (int) $dateOfNY->diff($date)->format('%a'); + } +} \ No newline at end of file diff --git a/public/public/index.php b/public/public/index.php index 1796435d79dc3fc8a9830915e5a10b90d3cb7d11..f8c8b4633d44c06d307c5e0ba7b6bc077892c926 100644 --- a/public/public/index.php +++ b/public/public/index.php @@ -2,19 +2,24 @@ require_once __DIR__ . '/../vendor/autoload.php'; +use App\Actions\HowDaysToNYAction; use App\Actions\SortPriceAction; use App\Actions\IdSearchAction; use App\Actions\PrepareMenuAction; use App\TestData\TestData; +echo 'HowDaysToNYAction:
'; +echo "Дней до нового года (в днях): ". HowDaysToNYAction::count(new DateTimeImmutable()); +echo '
'; + echo 'SortPriceAction:
'; var_dump(SortPriceAction::sort(TestData::PRICE_COUNT_ARRAY)); echo '
'; echo 'PrepareMenuAction:
'; var_dump(PrepareMenuAction::prepare(TestData::RAW_MENU)); -echo '
' +echo '
'; -echo 'IdSearchAction:
' +echo 'IdSearchAction:
'; var_dump(IdSearchAction::search(TestData::ARRAY_FOR_SEARCHING)); -echo '
' +echo '
';