src/core/DeCaptchaAbstract.php
protected function getParams($action, $field = null)
    {
        if (empty($this->actions[$action])) {
            return [];
        }
        $fields = $this->actions[$action][static::ACTION_FIELDS];
        if (!is_null($field)) {
            $fields = $fields[$field][static::ACTION_FIELDS];
        }
        $params = [];
        foreach ($fields as $field => $settings) {
            $value = null;
            if (array_key_exists(self::PARAM_SLUG_DEFAULT, $settings)) {
                $value = $settings[self::PARAM_SLUG_DEFAULT];
            }
            if (array_key_exists($field, $this->params) && (!array_key_exists(self::PARAM_SLUG_VARIABLE, $settings) ^ (array_key_exists(self::PARAM_SLUG_VARIABLE, $settings) && $settings[self::PARAM_SLUG_VARIABLE] === false))) {
                $value = $this->params[$field];
            }
            if (array_key_exists(self::PARAM_SLUG_SPEC, $settings)) {
                $value = $this->getParamSpec($field, $settings[self::PARAM_SLUG_SPEC], array_key_exists(self::PARAM_SLUG_CODING, $settings) ? $settings[self::PARAM_SLUG_CODING] : null);
            }
            if (is_null($value)) {
                if (array_key_exists(self::PARAM_SLUG_REQUIRE, $settings) && $settings[self::PARAM_SLUG_REQUIRE] === true) {
                    throw new DeCaptchaErrors(DeCaptchaErrors::ERROR_PARAM_REQUIRE, array_key_exists($field, $this->paramsNames) ? $this->paramsNames[$field] : $field, $this->errorLang);
                }
                continue;
            }
            if (array_key_exists($field, $this->paramsNames)) {
                switch ($settings[self::PARAM_SLUG_TYPE]) {
                    case self::PARAM_FIELD_TYPE_FLOAT:
                        $value = (float) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_INTEGER:
                        $value = (int) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_STRING:
                        $value = (string) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_BOOLEAN:
                        $value = (bool) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_OBJECT:
                        $value = $this->getParams($action, $field);
                        break;
                }
                if (array_key_exists(self::PARAM_SLUG_ENUM, $settings) && !in_array($value, $settings[static::PARAM_SLUG_ENUM])) {
                    throw new DeCaptchaErrors(DeCaptchaErrors::ERROR_PARAM_ENUM, (array_key_exists($field, $this->paramsNames) ? $this->paramsNames[$field] : $field).' = '.$value, $this->errorLang);
                }
                $params[$this->paramsNames[$field]] = $value;
            }
        }

        return $params;
    }
protected function getParams($action, $field = null)
    {
        if (empty($this->actions[$action])) {
            return [];
        }
        $fields = $this->actions[$action][static::ACTION_FIELDS];
        if (!is_null($field)) {
            $fields = $fields[$field][static::ACTION_FIELDS];
        }
        $params = [];
        foreach ($fields as $field => $settings) {
            $value = null;
            if (array_key_exists(self::PARAM_SLUG_DEFAULT, $settings)) {
                $value = $settings[self::PARAM_SLUG_DEFAULT];
            }
            if (array_key_exists($field, $this->params) && (!array_key_exists(self::PARAM_SLUG_VARIABLE, $settings) ^ (array_key_exists(self::PARAM_SLUG_VARIABLE, $settings) && $settings[self::PARAM_SLUG_VARIABLE] === false))) {
                $value = $this->params[$field];
            }
            if (array_key_exists(self::PARAM_SLUG_SPEC, $settings)) {
                $value = $this->getParamSpec($field, $settings[self::PARAM_SLUG_SPEC], array_key_exists(self::PARAM_SLUG_CODING, $settings) ? $settings[self::PARAM_SLUG_CODING] : null);
            }
            if (is_null($value)) {
                if (array_key_exists(self::PARAM_SLUG_REQUIRE, $settings) && $settings[self::PARAM_SLUG_REQUIRE] === true) {
                    throw new DeCaptchaErrors(DeCaptchaErrors::ERROR_PARAM_REQUIRE, array_key_exists($field, $this->paramsNames) ? $this->paramsNames[$field] : $field, $this->errorLang);
                }
                continue;
            }
            if (array_key_exists($field, $this->paramsNames)) {
                switch ($settings[self::PARAM_SLUG_TYPE]) {
                    case self::PARAM_FIELD_TYPE_FLOAT:
                        $value = (float) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_INTEGER:
                        $value = (int) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_STRING:
                        $value = (string) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_BOOLEAN:
                        $value = (bool) $value;
                        break;
                    case self::PARAM_FIELD_TYPE_OBJECT:
                        $value = $this->getParams($action, $field);
                        break;
                }
                if (array_key_exists(self::PARAM_SLUG_ENUM, $settings) && !in_array($value, $settings[static::PARAM_SLUG_ENUM])) {
                    throw new DeCaptchaErrors(DeCaptchaErrors::ERROR_PARAM_ENUM, (array_key_exists($field, $this->paramsNames) ? $this->paramsNames[$field] : $field).' = '.$value, $this->errorLang);
                }
                $params[$this->paramsNames[$field]] = $value;
            }
        }

        return $params;
    }
@param $action
@param $field

@throws DeCaptchaErrors

@return array