-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormErrorPrinterInterface.php
More file actions
59 lines (52 loc) · 1.15 KB
/
FormErrorPrinterInterface.php
File metadata and controls
59 lines (52 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
namespace Bdf\Form\Error;
use Bdf\Form\Child\Http\HttpFieldPath;
/**
* Print and format form errors
* Printer are single use objects
*
* Note: Element's errors are set before children ones
*/
interface FormErrorPrinterInterface
{
/**
* Print the "global" error
*
* @param string $error
*
* @see FormError::global()
*/
public function global(string $error): void;
/**
* Print the error code
*
* @param string $code
*
* @see FormError::code()
*/
public function code(string $code): void;
/**
* Print the HTTP field
*
* @param HttpFieldPath $field
*
* @see FormError::field()
*/
public function field(HttpFieldPath $field): void;
/**
* Print a child error
*
* @param string $name The child name
* @param FormError $error The child error
*
* @see FormError::children()
*/
public function child(string $name, FormError $error): void;
/**
* Print / finalize the printer
* After this call, the printer should not be reused
*
* @return mixed
*/
public function print(): mixed;
}