mirror of
https://github.com/Respect/Validation.git
synced 2024-06-29 10:40:24 +02:00
-Simplified defaultTemplates on Exceptions -Exceptions now can be iterated and recursively iterated -Messages built by RecursiveTreeIterator (SPL), faster an simpler -attribute, key and composite exceptions message plays nicer (no redundant messages)
20 lines
391 B
PHP
20 lines
391 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class KeyException extends AbstractRelatedException
|
|
{
|
|
public static $defaultTemplates = array(
|
|
'"%2$s" is not present',
|
|
'"%2$s" is invalid',
|
|
);
|
|
|
|
public function chooseTemplate($input, $attributeName, $theAttribute)
|
|
{
|
|
if (!$theAttribute)
|
|
return 0;
|
|
else
|
|
return 1;
|
|
}
|
|
|
|
} |