diff --git a/src/php/src/Api/Documentation/Attributes/ApiResponse.php b/src/php/src/Api/Documentation/Attributes/ApiResponse.php index 222350b..ee35835 100644 --- a/src/php/src/Api/Documentation/Attributes/ApiResponse.php +++ b/src/php/src/Api/Documentation/Attributes/ApiResponse.php @@ -64,7 +64,7 @@ readonly class ApiResponse 302 => 'Found (redirect)', 304 => 'Not modified', 400 => 'Bad request', - 401 => 'Unauthorized', + 401 => 'Unauthorised', 403 => 'Forbidden', 404 => 'Not found', 405 => 'Method not allowed', diff --git a/src/php/src/Api/Documentation/Extensions/ApiKeyAuthExtension.php b/src/php/src/Api/Documentation/Extensions/ApiKeyAuthExtension.php index baf0259..0344700 100644 --- a/src/php/src/Api/Documentation/Extensions/ApiKeyAuthExtension.php +++ b/src/php/src/Api/Documentation/Extensions/ApiKeyAuthExtension.php @@ -53,7 +53,7 @@ class ApiKeyAuthExtension implements Extension 'properties' => [ 'message' => [ 'type' => 'string', - 'example' => 'This action is unauthorized.', + 'example' => 'This action is unauthorised.', ], ], ]; diff --git a/src/php/src/Api/Middleware/AuthenticateApiKey.php b/src/php/src/Api/Middleware/AuthenticateApiKey.php index 839ed4e..ecddfc5 100644 --- a/src/php/src/Api/Middleware/AuthenticateApiKey.php +++ b/src/php/src/Api/Middleware/AuthenticateApiKey.php @@ -116,7 +116,7 @@ class AuthenticateApiKey } /** - * Return 401 Unauthorized response. + * Return 401 Unauthorised response. */ protected function unauthorized(string $message): Response { diff --git a/src/php/src/Api/Resources/ErrorResource.php b/src/php/src/Api/Resources/ErrorResource.php index ca62eca..a39ba38 100644 --- a/src/php/src/Api/Resources/ErrorResource.php +++ b/src/php/src/Api/Resources/ErrorResource.php @@ -40,7 +40,7 @@ class ErrorResource extends JsonResource /** * Common error factory methods. */ - public static function unauthorized(string $message = 'Unauthorized'): static + public static function unauthorized(string $message = 'Unauthorised'): static { return new static('unauthorized', $message); } diff --git a/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php b/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php index 8bf742c..f185b05 100644 --- a/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php +++ b/src/php/src/Api/Tests/Feature/OpenApiDocumentationComprehensiveTest.php @@ -398,7 +398,7 @@ describe('ApiResponse Attribute Rendering', function () { 201 => 'Resource created', 204 => 'No content', 400 => 'Bad request', - 401 => 'Unauthorized', + 401 => 'Unauthorised', 403 => 'Forbidden', 404 => 'Not found', 422 => 'Validation error', @@ -724,7 +724,7 @@ describe('Extension System', function () { // ───────────────────────────────────────────────────────────────────────────── describe('Error Response Documentation', function () { - it('documents 401 Unauthorized response', function () { + it('documents 401 Unauthorised response', function () { $extension = new ApiKeyAuthExtension; $spec = [ 'info' => [],