public function setType($key, $type)
    {
        $args = func_get_args();
        $type = array_pop($args);

        if (!($type instanceof Validator))
            $type = new Validator($type);

        if ($this->types->has($args))
        {
            $old_type = $this->types->get($args); 
            if ($old_type != $type)
                throw new \LogicException("Duplicate key: " . WF::str($args));
        }
        else
        {
            $args[] = $type;
            $this->types->set($args, null);
        }
        return $this;
    }
public function setType($key, $type)
    {
        $args = func_get_args();
        $type = array_pop($args);

        if (!($type instanceof Validator))
            $type = new Validator($type);

        if ($this->types->has($args))
        {
            $old_type = $this->types->get($args); 
            if ($old_type != $type)
                throw new \LogicException("Duplicate key: " . WF::str($args));
        }
        else
        {
            $args[] = $type;
            $this->types->set($args, null);
        }
        return $this;
    }
public function setType ( $ key , $ type ) { $ args = func_get_args ( ) ; $ type = array_pop ( $ args ) ; if ( ! ( $ type instanceof Validator ) ) $ type = new Validator ( $ type ) ; if ( $ this -> types -> has ( $ args ) ) { $ old_type = $ this -> types -> get ( $ args ) ; if ( $ old_type != $ type ) throw new \ LogicException ( "Duplicate key: " . WF :: str ( $ args ) ) ; } else { $ args [ ] = $ type ; $ this -> types -> set ( $ args , null ) ; } return $ this ; }
Add a type for a parameter
@param string $key The key to set a type for. Can be repeated to go deeper
@param Validator $type The type for the parameter
@return TypedDictionary Provides fluent interface
Add a type for a parameter