Skip to content
This repository was archived by the owner on Jul 6, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (20 loc) · 516 Bytes

File metadata and controls

25 lines (20 loc) · 516 Bytes

ApiProblemErrorMessages

<?php

use Chubbyphp\Validation\Error\Error;
use Chubbyphp\Validation\Error\ApiProblemErrorMessages;

$error = new Error(
    'path.to.property',
    'constraint.constraint.invalidtype',
    ['type' => 'array']
);

$errorMessages = new ApiProblemErrorMessages([$error]);

$errorMessages->getMessages();
// [
//     [
//         'name' => 'path.to.property',
//         'reason' => 'constraint.constraint.invalidtype',
//         'details' => ['type' => 'array'],
//     ],
// ]