1
0
mirror of synced 2024-11-24 22:06:06 +03:00

Fix errors

This commit is contained in:
Кривич Сергей 2022-07-20 14:54:24 +03:00
parent 897df39d96
commit 430c5d9d4a
4 changed files with 17 additions and 10 deletions

View File

@ -9,14 +9,14 @@ class InvalidRequestArgumentException extends InvalidArgumentException
{ {
private $validateErrors; private $validateErrors;
public function __construct(string $message = "", int $code = 0, array $errors = [], Throwable $previous = null) public function __construct(string $message = "", int $code = 0, iterable $errors = [], Throwable $previous = null)
{ {
parent::__construct($message, $code, $previous); parent::__construct($message, $code, $previous);
$this->validateErrors = $errors; $this->validateErrors = $errors;
} }
public function getValidateErrors(): array public function getValidateErrors(): iterable
{ {
return $this->validateErrors; return $this->validateErrors;
} }

View File

@ -4,9 +4,18 @@ namespace RetailCrm\ServiceBundle\Models;
class Error class Error
{ {
public string $code; /**
* @var string
*/
public $code;
public string $message; /**
* @var string
*/
public $message;
public array $details; /**
* @var array
*/
public $details;
} }

View File

@ -15,11 +15,8 @@ abstract class AbstractClientAuthenticator extends AbstractAuthenticator
{ {
public const AUTH_FIELD = 'clientId'; public const AUTH_FIELD = 'clientId';
private $errorResponseFactory; public function __construct(private ErrorJsonResponseFactory $errorResponseFactory)
public function __construct(ErrorJsonResponseFactory $errorResponseFactory)
{ {
$this->errorResponseFactory = $errorResponseFactory;
} }
abstract public function supports(Request $request): ?bool; abstract public function supports(Request $request): ?bool;

View File

@ -8,8 +8,9 @@ use JMS\Serializer\Annotation as JMS;
class RequestDto class RequestDto
{ {
/** /**
* @var string
* @Assert\NotNull() * @Assert\NotNull()
* @JMS\Type("string") * @JMS\Type("string")
*/ */
public string $param; public $param;
} }