This repository was archived by the owner on May 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathValidationErrorList.php
More file actions
executable file
·111 lines (103 loc) · 3.11 KB
/
ValidationErrorList.php
File metadata and controls
executable file
·111 lines (103 loc) · 3.11 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/**
* OWASP Enterprise Security API (ESAPI)
*
* This file is part of the Open Web Application Security Project (OWASP)
* Enterprise Security API (ESAPI) project.
*
* PHP version 5.2
*
* LICENSE: This source file is subject to the New BSD license. You should read
* and accept the LICENSE before you use, modify, and/or redistribute this
* software.
*
* @category OWASP
* @package ESAPI
* @author Mike Boberski <boberski_michael@bah.com>
* @author Andrew van der Stock <vanderaj@owasp.org>
* @copyright 2009-2010 The OWASP Foundation
* @license http://www.opensource.org/licenses/bsd-license.php New BSD license
* @version SVN: $Id$
* @link http://www.owasp.org/index.php/ESAPI
*/
require_once dirname(__FILE__).'/errors/ValidationException.php';
/**
* Use this ESAPI security control to enumerate validation exceptions.
*
* The idea behind this interface is to define a well-formed collection of
* ValidationExceptions so that groups of validation functions can be
* called in a non-blocking fashion.
*
* @category OWASP
* @package ESAPI
* @author Mike Boberski <boberski_michael@bah.com>
* @author Andrew van der Stock <vanderaj@owasp.org>
* @copyright 2009-2010 The OWASP Foundation
* @license http://www.opensource.org/licenses/bsd-license.php New BSD license
* @version Release: @package_version@
* @link http://www.owasp.org/index.php/ESAPI
*/
class ValidationErrorList
{
/**
* Error list of ValidationException's
*/
// private HashMap errorList = new HashMap();
/**
* Adds a new error to list with a unique named context.
* No action taken if either element is null.
* Existing contexts will be overwritten.
*
* @param string $context unique named context for this ValidationErrorList
* @param string $ve todo
*
* @return string todo
*/
public function addError($context, $ve)
{
// if (getError(context) != null) throw new RuntimeException("Context (" + context + ") already exists, programmer error");
//
// if ((context != null) && (ve != null)) {
// errorList.put(context, ve);
// }
}
/**
* Returns list of ValidationException, or empty list of no errors exist.
*
* @return arrray todo
*/
public function errors()
{
// return new ArrayList( errorList.values() );
}
/**
* Retrieves ValidationException for given context if one exists.
*
* @param string $context unique name for each error
*
* @return ValidationException or null for given context
*/
public function getError($context)
{
// if (context == null) return null;
// return (ValidationException)errorList.get(context);
}
/**
* Returns true if no error are present.
*
* @return bool todo
*/
public function isEmpty()
{
// return errorList.isEmpty();
}
/**
* Returns the numbers of errors present.
*
* @return bool todo
*/
public function size()
{
// return errorList.size();
}
}