Skip to content

исправление ошибок#14

Open
Notnochka wants to merge 3 commits intohtmlacademy-php:masterfrom
Notnochka:module7-task2
Open

исправление ошибок#14
Notnochka wants to merge 3 commits intohtmlacademy-php:masterfrom
Notnochka:module7-task2

Conversation

@Notnochka
Copy link
Copy Markdown
Contributor

No description provided.

* @return array
*/

function addLotForm(array $postData, array $fileData, mysqli $db, array $categories, int $userId): array
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

создать в папке functions файл forms.php либо forms-handle.php и перенести эту функцию туда

* @return string|null
*/

function processFileUpload(array $file, string $uploadDir): ?string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

создать в папке functions файл files.php и перенсти функцию туда

* @return array
*/

function authenticateUser(string $email, string $password, mysqli $db): array {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mysqli $db заменить на mysqli $link и сделать первым аргументом в функции

* @return int
*/

function isUserAuthenticated(mysqli $db): int {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

заменить тип на bool

} else {
$categoryId = (int)$_POST['category'];

$categoryExistsQuery = "SELECT id FROM categories WHERE id = ?";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

с 266 по 273 - можно вынести в отдельную функцию
function checkCategoryExeist(int $id): bool

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