public function required($type)
    {
        $count = count($this->arguments);
        $argument = $this->optional($type);
        if ($count === count($this->arguments)) {
            throw new InvalidArgumentException('Arguments miss one of the '.$type.' type');
        }

        return $argument;
    }
public function required($type)
    {
        $count = count($this->arguments);
        $argument = $this->optional($type);
        if ($count === count($this->arguments)) {
            throw new InvalidArgumentException('Arguments miss one of the '.$type.' type');
        }

        return $argument;
    }
public function required ( $ type ) { $ count = count ( $ this -> arguments ) ; $ argument = $ this -> optional ( $ type ) ; if ( $ count === count ( $ this -> arguments ) ) { throw new InvalidArgumentException ( 'Arguments miss one of the ' . $ type . ' type' ) ; } return $ argument ; }
Ask for an required argument by type then pop and return
the first found from the list. If not found, throw an exception.

@param $type

@throws InvalidArgumentException

@return mixed
Ask for an required argument by type then pop and return the first found from the list . If not found throw an exception .