refactor(api): HttpStatus and Response HTTP_* constants#209
Open
Ibochkarev wants to merge 1 commit intofix/gh-207-manager-order-product-eventsfrom
Open
refactor(api): HttpStatus and Response HTTP_* constants#209Ibochkarev wants to merge 1 commit intofix/gh-207-manager-order-product-eventsfrom
Ibochkarev wants to merge 1 commit intofix/gh-207-manager-order-product-eventsfrom
Conversation
Introduce MiniShop3\Router\HttpStatus; Response aliases it and uses explicit nullable/mixed signatures. Replace literal status codes in API Response::error call sites. OrdersController keeps msOrderProduct lifecycle events from the parent branch with named constants for HTTP statuses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
Введён класс
MiniShop3\Router\HttpStatusс базовыми кодами ответа;Responseиспользует эти значения через публичные константыResponse::HTTP_*(в т.ч.HTTP_NOT_FOUND). Сигнатурыsuccess/errorуточнены под строгую типизацию (mixed, явный?string). Магические числа вResponse::errorи связанных вызовах заменены на именованные константы по роутам и API-контроллерам; обновлёнRouter.Поведение HTTP-ответов не меняется по смыслу — только читаемость и единообразие.
База PR: ветка
fix/gh-207-manager-order-product-events. После мержа этого PR в ту ветку и мержа #207 вbetaможно влить оставшиеся изменения одним потоком, либо ребейзнуть эту ветку на обновлённыйbeta.Тип изменений
Связанные Issues
Refs #207 (контекст — тот же
OrdersControllerполучает константы вместо литералов; основной фикc в отдельном PR).Как это было протестировано?
Статический обзор диффа: замена констант, без изменения ветвлений по кодам.
Конфигурация тестирования:
Скриншоты (если применимо)
Чеклист
Дополнительные заметки
Рекомендуемый порядок: смержить PR с #207 в
beta, затемrefactor/http-status-response-constantsперебазировать наbetaи открыть отдельный PR вbeta, если второй PR шёл только в ветку фикса. Текущий PR нацелен на ветку фикса, чтобы дифф оставался только рефакторингом без дублирования с #207.