public function setOptions(array $options)
    {
        foreach ($options as $option => $config) {
            if (! (bool) preg_match("/^[0-9A-Za-z_]+$/", $option))
                // invalid option format
                throw new InvalidArgumentException("Invalid option name provided to evias\\NEMBlockchain\\API@setOptions: " . var_export($option, true));

            $upper  = str_replace(" ", "", ucwords(str_replace("_", " ", $option)));
            $setter = "set" . $upper;

            if (method_exists($this, $setter))
                $this->$setter($config);
            elseif (method_exists($this->getRequestHandler(), $setter))
                $this->getRequestHandler()->$setter($config);
        }

        return $this;
    }
public function setOptions(array $options)
    {
        foreach ($options as $option => $config) {
            if (! (bool) preg_match("/^[0-9A-Za-z_]+$/", $option))
                // invalid option format
                throw new InvalidArgumentException("Invalid option name provided to evias\\NEMBlockchain\\API@setOptions: " . var_export($option, true));

            $upper  = str_replace(" ", "", ucwords(str_replace("_", " ", $option)));
            $setter = "set" . $upper;

            if (method_exists($this, $setter))
                $this->$setter($config);
            elseif (method_exists($this->getRequestHandler(), $setter))
                $this->getRequestHandler()->$setter($config);
        }

        return $this;
    }
public function setOptions ( array $ options ) { foreach ( $ options as $ option => $ config ) { if ( ! ( bool ) preg_match ( "/^[0-9A-Za-z_]+$/" , $ option ) ) // invalid option format throw new InvalidArgumentException ( "Invalid option name provided to evias\\NEMBlockchain\\API@setOptions: " . var_export ( $ option , true ) ) ; $ upper = str_replace ( " " , "" , ucwords ( str_replace ( "_" , " " , $ option ) ) ) ; $ setter = "set" . $ upper ; if ( method_exists ( $ this , $ setter ) ) $ this -> $ setter ( $ config ) ; elseif ( method_exists ( $ this -> getRequestHandler ( ) , $ setter ) ) $ this -> getRequestHandler ( ) -> $ setter ( $ config ) ; } return $ this ; }
This method allows to set the API configuration
through an array rather than using the Laravel
and Lumen Config contracts.

@param  array $options
@return \NEM\API
@throws InvalidArgumentException on invalid option names.
This method allows to set the API configuration through an array rather than using the Laravel and Lumen Config contracts .