public function map($type, $transformation)
    {
        if (!is_callable($transformation))
            throw new InvalidTransformationException('Transformations must be callable objects');

        foreach ((array) $type as $t) {
            $this->getMatcher()->rule('type', $t, $transformation);
        }

        return $this;
    }
public function map($type, $transformation)
    {
        if (!is_callable($transformation))
            throw new InvalidTransformationException('Transformations must be callable objects');

        foreach ((array) $type as $t) {
            $this->getMatcher()->rule('type', $t, $transformation);
        }

        return $this;
    }
public function map ( $ type , $ transformation ) { if ( ! is_callable ( $ transformation ) ) throw new InvalidTransformationException ( 'Transformations must be callable objects' ) ; foreach ( ( array ) $ type as $ t ) { $ this -> getMatcher ( ) -> rule ( 'type' , $ t , $ transformation ) ; } return $ this ; }
Register a map for the compiler, that matches on type

@param string|array $type The type/s of the expressions that will be transformed
@param callable $transformation The transformation
@throws InvalidTransformationException

@return $this                    The current instance
Register a map for the compiler that matches on type