Skip to content

Commit

Permalink
Add TypeTrait methods to TypeInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
emonkak committed Oct 15, 2018
1 parent 14ab7e4 commit 97ce3b1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Type/TypeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Emonkak\Validation\Type;

use Emonkak\Validation\Collector\CollectorInterface;
use Emonkak\Validation\Constraint\ConstraintInterface;

interface TypeInterface
{
Expand All @@ -18,4 +19,25 @@ public function getDeclaration();
* @return bool
*/
public function validate($key, $value, CollectorInterface $collector);

/**
* @return TypeInterface
*/
public function allowEmpty();

/**
* @return TypeInterface
*/
public function isOptional();

/**
* @param ConstraintInterface[] ...$constraints
* @return ConstrainedType
*/
public function withConstraints(ConstraintInterface ...$constraints);

/**
* @return TypeInterface
*/
public function union(TypeInterface ...$types);
}

0 comments on commit 97ce3b1

Please sign in to comment.