/** * Creates a bool mapping. * * @param string $message The error message * * @return Mapping */ public function bool($message = 'error.bool') { $mapping = new Mapping(new Emitter(), $this->extensions); $mapping->transform(new Transformer\BoolTransformer()); $mapping->validate(new Constraint\Type($message, 'bool')); return $mapping; }