protected function _getAndValidateArguments($arguments)
    {
        $className = get_class($this);
        if (!isset(self::$_argumentNames[$className])) {
            $reflection = new ReflectionMethod($this, 'create');
            self::$_argumentNames[$className] = array();
            foreach($reflection->getParameters() as $parameter) {
                self::$_argumentNames[$className][] = $parameter;
            }
        }

        $count = 0;
        $argumentNamesAndValues = array();
        foreach(self::$_argumentNames[$className] as $parameter) {
            if (array_key_exists($count, $arguments)) {
                $value = $arguments[$count];
            } else if ($parameter->isOptional()) {
                $value = $parameter->getDefaultValue();
            } else {
                throw new Rediska_Command_Exception("Argument '{$parameter->getName()}' not present for command '$this->_name'");
            }
            $argumentNamesAndValues[$parameter->getName()] = $value;
            $count++;
        }

        return $argumentNamesAndValues;
    }
protected function _getAndValidateArguments($arguments)
    {
        $className = get_class($this);
        if (!isset(self::$_argumentNames[$className])) {
            $reflection = new ReflectionMethod($this, 'create');
            self::$_argumentNames[$className] = array();
            foreach($reflection->getParameters() as $parameter) {
                self::$_argumentNames[$className][] = $parameter;
            }
        }

        $count = 0;
        $argumentNamesAndValues = array();
        foreach(self::$_argumentNames[$className] as $parameter) {
            if (array_key_exists($count, $arguments)) {
                $value = $arguments[$count];
            } else if ($parameter->isOptional()) {
                $value = $parameter->getDefaultValue();
            } else {
                throw new Rediska_Command_Exception("Argument '{$parameter->getName()}' not present for command '$this->_name'");
            }
            $argumentNamesAndValues[$parameter->getName()] = $value;
            $count++;
        }

        return $argumentNamesAndValues;
    }
protected function _getAndValidateArguments ( $ arguments ) { $ className = get_class ( $ this ) ; if ( ! isset ( self :: $ _argumentNames [ $ className ] ) ) { $ reflection = new ReflectionMethod ( $ this , 'create' ) ; self :: $ _argumentNames [ $ className ] = array ( ) ; foreach ( $ reflection -> getParameters ( ) as $ parameter ) { self :: $ _argumentNames [ $ className ] [ ] = $ parameter ; } } $ count = 0 ; $ argumentNamesAndValues = array ( ) ; foreach ( self :: $ _argumentNames [ $ className ] as $ parameter ) { if ( array_key_exists ( $ count , $ arguments ) ) { $ value = $ arguments [ $ count ] ; } else if ( $ parameter -> isOptional ( ) ) { $ value = $ parameter -> getDefaultValue ( ) ; } else { throw new Rediska_Command_Exception ( "Argument '{$parameter->getName()}' not present for command '$this->_name'" ) ; } $ argumentNamesAndValues [ $ parameter -> getName ( ) ] = $ value ; $ count ++ ; } return $ argumentNamesAndValues ; }
Get and validate command arguments

@param array $arguments
@return array
Get and validate command arguments