protected function getAnnotations(
        array $annotations,
        array $arguments = array()
    ) {
        $options = array();
        foreach ($annotations as $params) {
            foreach ($params as $param) {
                if ($param instanceof SecureParam) {
                    /** @var $param SecureParam */
                    $options['secureParams'][$param->name] = $this->annotationToArray($param);
                    /* @var $argument \ReflectionParameter */
                    $argument = $arguments[$param->name];
                    $class    = $argument->getClass();
                    if (!$class) {
                        throw new \InvalidArgumentException(sprintf(
                            'Secured action parameter has no class definition'
                        ));
                    }

                    $options['secureParams'][$param->name]['class'] = $class->getName();
                } else {
                    if ($param instanceof Secure || $param instanceof Menu || $param instanceof MenuDefault) {
                        $options += $this->annotationToArray($param);
                    }
                }
            }
        }

        foreach ($annotations as $params) {
            foreach ($params as $param) {
                if ($param instanceof ParamConverter && isset($options['secureParams'][$param->getName()])) {
                    /** @var $param ParamConverter*/
                    $options['secureParams'][$param->getName()]['class'] = $param->getClass();
                }
            }
        }

        return $options;
    }
protected function getAnnotations(
        array $annotations,
        array $arguments = array()
    ) {
        $options = array();
        foreach ($annotations as $params) {
            foreach ($params as $param) {
                if ($param instanceof SecureParam) {
                    /** @var $param SecureParam */
                    $options['secureParams'][$param->name] = $this->annotationToArray($param);
                    /* @var $argument \ReflectionParameter */
                    $argument = $arguments[$param->name];
                    $class    = $argument->getClass();
                    if (!$class) {
                        throw new \InvalidArgumentException(sprintf(
                            'Secured action parameter has no class definition'
                        ));
                    }

                    $options['secureParams'][$param->name]['class'] = $class->getName();
                } else {
                    if ($param instanceof Secure || $param instanceof Menu || $param instanceof MenuDefault) {
                        $options += $this->annotationToArray($param);
                    }
                }
            }
        }

        foreach ($annotations as $params) {
            foreach ($params as $param) {
                if ($param instanceof ParamConverter && isset($options['secureParams'][$param->getName()])) {
                    /** @var $param ParamConverter*/
                    $options['secureParams'][$param->getName()]['class'] = $param->getClass();
                }
            }
        }

        return $options;
    }
protected function getAnnotations ( array $ annotations , array $ arguments = array ( ) ) { $ options = array ( ) ; foreach ( $ annotations as $ params ) { foreach ( $ params as $ param ) { if ( $ param instanceof SecureParam ) { /** @var $param SecureParam */ $ options [ 'secureParams' ] [ $ param -> name ] = $ this -> annotationToArray ( $ param ) ; /* @var $argument \ReflectionParameter */ $ argument = $ arguments [ $ param -> name ] ; $ class = $ argument -> getClass ( ) ; if ( ! $ class ) { throw new \ InvalidArgumentException ( sprintf ( 'Secured action parameter has no class definition' ) ) ; } $ options [ 'secureParams' ] [ $ param -> name ] [ 'class' ] = $ class -> getName ( ) ; } else { if ( $ param instanceof Secure || $ param instanceof Menu || $ param instanceof MenuDefault ) { $ options += $ this -> annotationToArray ( $ param ) ; } } } } foreach ( $ annotations as $ params ) { foreach ( $ params as $ param ) { if ( $ param instanceof ParamConverter && isset ( $ options [ 'secureParams' ] [ $ param -> getName ( ) ] ) ) { /** @var $param ParamConverter*/ $ options [ 'secureParams' ] [ $ param -> getName ( ) ] [ 'class' ] = $ param -> getClass ( ) ; } } } return $ options ; }
Merge array of annotations to options

@param  array $options
@param  array $annotations
@param        array[\ReflectionParameter] $arguments

@return array
Merge array of annotations to options