1<?php
2/**
3 * Zend Framework (http://framework.zend.com/)
4 *
5 * @link      http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license   http://framework.zend.com/license/new-bsd New BSD License
8 */
9
10namespace Zend\Validator;
11
12interface ValidatorInterface
13{
14    /**
15     * Returns true if and only if $value meets the validation requirements
16     *
17     * If $value fails validation, then this method returns false, and
18     * getMessages() will return an array of messages that explain why the
19     * validation failed.
20     *
21     * @param  mixed $value
22     * @return bool
23     * @throws Exception\RuntimeException If validation of $value is impossible
24     */
25    public function isValid($value);
26
27    /**
28     * Returns an array of messages that explain why the most recent isValid()
29     * call returned false. The array keys are validation failure message identifiers,
30     * and the array values are the corresponding human-readable message strings.
31     *
32     * If isValid() was never called or if the most recent isValid() call
33     * returned true, then this method returns an empty array.
34     *
35     * @return array
36     */
37    public function getMessages();
38}
39