Skip to content

Commit

Permalink
Merge pull request #803 from spiral/feature/validation
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Sep 28, 2022
1 parent 8a7ae9d commit 9cf4105
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ErrorMapper.php
Expand Up @@ -13,6 +13,10 @@ public function __construct(
) {
}

/**
* @param array<string, string> $errors
* @return array<string, string>
*/
public function mapErrors(array $errors): array
{
// De-mapping
Expand Down
16 changes: 16 additions & 0 deletions src/ErrorsRendererInterface.php
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Spiral\Filters;

use Psr\Http\Message\ResponseInterface;

interface ErrorsRendererInterface
{
/**
* Convert errors into a response object.
* @param array<string, string> $errors
*/
public function render(array $errors, mixed $context = null): ResponseInterface;
}

0 comments on commit 9cf4105

Please sign in to comment.