Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Работа со строкой запроса #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Glorferiel39
Copy link
Contributor

No description provided.

@@ -0,0 +1,10 @@
<?php
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

переименовать файл в config.php, тк он содержит не только данные для подключения к БД

* @return mysqli_stmt Подготовленное выражение
*/

function dbGetPrepareStmt(mysqli $link, $sql, $data = []) : mysqli_stmt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

дополнить сигнатуру типами:
string $sql, array $data = [])

* @param array $data Ассоциативный массив с данными для шаблона
* @return string Итоговый HTML
*/
function includeTemplate($name, array $data = []) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(string $name, array $data = []): string

*@param string $data
*@return int
*/
function remainingTime(string $date): int
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: array


/**
*@param string $data
*@return int
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправить phpdoc

* @return string Итоговый HTML
*/

function includeTemplate($name, array $data = [])
Copy link
Collaborator

@sergeivl sergeivl Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string $name, array $data = []): string

$formatToCheck = 'Y-m-d';
$dateTimeObj = date_create_from_format($formatToCheck, $date);

return $dateTimeObj !== false && array_sum(date_get_last_errors()) === 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return $dateTimeObj !== false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants