Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Zend\Code\Generator\MethodGenerator does not accept parameters as array #6420

Closed
buonaparte opened this issue Jun 27, 2014 · 1 comment
Closed
Assignees
Milestone

Comments

@buonaparte
Copy link

Zend\Code\Generator\MethodGenerator does not accept parameters to be specified as array (although Exception does mention this method as well):

   /**
     * @param  ParameterGenerator|string $parameter
     * @throws Exception\InvalidArgumentException
     * @return MethodGenerator
     */
    public function setParameter($parameter)
    {
        if (is_string($parameter)) {
            $parameter = new ParameterGenerator($parameter);
        } elseif (!$parameter instanceof ParameterGenerator) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s is expecting either a string, array or an instance of %s\ParameterGenerator',
                __METHOD__,
                __NAMESPACE__
            ));
        }

        $parameterName = $parameter->getName();

        $this->parameters[$parameterName] = $parameter;

        return $this;
    }
@Ocramius
Copy link
Member

Handled in #6422

gianarb pushed a commit to zendframework/zend-stdlib that referenced this issue May 15, 2015
gianarb pushed a commit to zendframework/zend-filter that referenced this issue May 15, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants