2010-09-23 21:46:46 +02:00
|
|
|
<?php
|
2015-06-08 16:47:14 +02:00
|
|
|
|
2015-06-08 17:09:25 +02:00
|
|
|
/*
|
|
|
|
* This file is part of Respect/Validation.
|
|
|
|
*
|
|
|
|
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the "LICENSE.md"
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2017-11-19 19:01:31 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2010-09-23 21:46:46 +02:00
|
|
|
namespace Respect\Validation;
|
|
|
|
|
2012-03-23 03:53:06 +01:00
|
|
|
/** Interface for validation rules */
|
2010-09-23 21:46:46 +02:00
|
|
|
interface Validatable
|
|
|
|
{
|
2010-09-25 02:28:03 +02:00
|
|
|
public function assert($input);
|
2010-09-23 21:46:46 +02:00
|
|
|
|
2018-01-28 16:14:00 +01:00
|
|
|
public function check($input): void;
|
2010-12-06 20:05:36 +01:00
|
|
|
|
2011-02-07 11:52:18 +01:00
|
|
|
public function getName();
|
|
|
|
|
2015-10-18 03:44:47 +02:00
|
|
|
public function reportError($input, array $relatedExceptions = []);
|
2011-02-07 11:52:18 +01:00
|
|
|
|
2011-02-06 23:21:15 +01:00
|
|
|
public function setName($name);
|
|
|
|
|
2011-04-17 17:29:48 +02:00
|
|
|
public function setTemplate($template);
|
|
|
|
|
2018-01-28 15:41:31 +01:00
|
|
|
public function validate($input): bool;
|
2011-02-06 23:21:15 +01:00
|
|
|
}
|