Проверяет параметр на сооветствие указанному типу.
@param string $param параметр
@param string $type тип
@return bool
172054
protected function checkParam($param, $type)
    {
        $type = $this->getTypeRegexp($type);

        return (bool) preg_match("#^{$type}$#", $param);
    }
211242
public function canHandle(string $type) : bool
    {
        $response = false;

        foreach ($this->contentTypes as $contentType) {
            if (stripos($type, $contentType) !== false) {
                $response = true;
                break;
            }
        }

        return $response;
    }
1018801
public function bind($param, $value, $type = null)
    {
        if (is_null($type)) {
            switch (true) {
                case is_int($value):
                    $type = PDO::PARAM_INT;
                    break;
                case is_bool($value):
                    $type = PDO::PARAM_BOOL;
                    break;
                case is_null($value):
                    $type = PDO::PARAM_NULL;
                    break;
                default:
                    $type = PDO::PARAM_STR;
            }
        }
        //then run PDO bindValue on the statement to bind the values
        self::$statement->bindValue($param, $value, $type);
    }
1053493
public function isSpam($type = 'email', $value)
    {
        $fullApiUrl = $this->buildUrl($type, $value);
        $response = $this->sendRequest($fullApiUrl);

        if (! $response) {
            throw new \Exception('API Check Unsuccessful on url: '.$fullApiUrl);
        }

        $result = json_decode($response);

        // check format
        if (! isset($result->success) ||
            ! isset($result->{$type}->appears) ||
            ! isset($result->{$type}->frequency)
        ) {
            logger($response);
            if (is_array($response)) {
                $response = implode(', ', $response);
            }
            throw new \Exception('Response has wrong format: '.$response);
        }

        // check success
        if ($result->success == 1 && $result->{$type}->appears == 1) {
            // check frequency
            return $result->{$type}->frequency >= $this->frequency;
        }

        return false;
    }
1107308
private static function defineParam(string $type, array $params, array $config = [])
    {
        // params
        if (isset($params[$type]) && !empty($params[$type])) {
            return $params[$type];
        // config
        } elseif (isset($config[$type]) && !empty($config[$type])) {
            return $config[$type];
        }

        // default
        return self::$$type;
    }
23134
protected function bindParameter(\PDOStatement $stmt, $params, $types)
    {
        !is_array($params) && $params = array($params);
        !is_array($types) && $types = array($types);

        $isIndex = is_int(key($params));
        $index = 1;

        foreach ($params as $name => $param) {
            // Number index parameters
            if ($isIndex) {
                if (isset($types[$index - 1])) {
                    $stmt->bindValue($index, $param, $types[$index - 1]);
                } else {
                    $stmt->bindValue($index, $param);
                }
                $index++;
            // Named parameters
            } else {
                if (isset($types[$name])) {
                    $stmt->bindValue($name, $param, $types[$name]);
                } else {
                    $stmt->bindValue($name, $param);
                }
            }
        }
    }
190449
public function hasRequiredParameter($parameter, $type = NULL) {
    return $this->hasParameter($parameter, $type) && $this->getParameterByName($parameter)->isRequired();
  }
1014721
public function bindColumn($column, &$param, $type = PDO::PARAM_STR, $maxlen = -1, $driverdata = null) {
		$type = $this->removeBitFlag($$type, PDO::PARAM_INPUT_OUTPUT);
		$ociParamType = $this->pdo2OciParamConst($type);
		// LOBs
		if ($lob_desc = $this->oci_lob_desc($ociParamType)) {
			$this->_lobs[$this->_lobsCount]['type'] = $ociParamType;
			$this->_lobs[$this->_lobsCount]['lob'] = @oci_new_descriptor($this->ociPdoAdapter->getOciConnection(), $lob_desc);
			$res = $this->_lobs[$this->_lobsCount]['lob'];
			$this->checkError($res);
			$res = @oci_define_by_name($this->stmt, $column, $this->_lobs[$this->_lobsCount]['lob'], $ociParamType);
			$this->checkError($res);
			$this->_lobs[$this->_lobsCount]['var'] = $param;
			$this->_lobs[$this->_lobsCount]['input'] = false;

			$this->_lobsCount++;
		}
		else {
			$res = @oci_define_by_name($this->stmt, $column, $param, $ociParamType);
			$this->checkError($res);
		}

		return $res;
	}
1018751
private function allowedTypeExist(string $type):bool
    {
        foreach ($this->allowed_text_render as $one) {
            if ($one["type"] === $type) {
                return (true);
            }
        }
        return (false);
    }
1220887
public static function requestHandler($type)
    {
        if (! self::validateRequest($type)) {
            return false;
        }

        App::setCurrentID(self::$config['app']);

        self::loadRemoteComplements();

        switch (self::$config['request']) {
            case 'load-complements':
                self::complementsLoadRequest();
                break;
            case 'change-state':
                self::changeStateRequest();
                break;
            case 'install':
                self::installRequest();
                break;
            case 'update':
                self::installRequest(true);
                break;
            case 'uninstall':
                self::uninstallRequest();
                break;
            default:
                self::$errors[] = [
                    'message' => 'Unknown request: ' . self::$config['request'],
                ];
                echo json_encode(['errors' => self::$errors]);
                break;
        }

        if (empty(App::getOption('development-environment'))) {
            die;
        }
    }
430979
protected function _delete($type, $id = null, array $parameters = []) {
        return $this->__delete($this->index(), $type, $id, $parameters);
    }
1223198
public function updateTranslations($params, $type)
    {
        if (is_null($translations = array_get($params, 'name'))) {
            return false;
        }
        try {
            DB::transaction(function() use($translations, $type) {
                foreach ($translations as $id => $value) {
                    $where        = [
                        'id'   => $id,
                        'area' => $type
                    ];
                    $model        = $this->makeModel()->newQuery()->where($where)->first();
                    $model->value = $value;
                    $model->save();
                }
            });
            return true;
        } catch (Exception $ex) {
            Log::emergency($ex);
            return false;
        }
    }
1267527
protected static function setParams($type, $data)
    {
        if (! isset($data['name'], $data['url'])) {
            return false;
        }

        if ($type === 'script') {
            $data['attr'] = isset($data['attr']) ? " {$data['attr']}" : '';
        }

        $data['version'] = isset($data['version']) ? $data['version'] : '0';

        $place = (isset($data['footer']) && $data['footer']) ? 'F' : 'H';

        $place = ($place === 'F') ? 'footer' : 'header';

        self::$data[$type][$place][$data['name']] = $data;

        return true;
    }
1136387
function isFunctionParam( $param )
    {
        $isFunction = false;
        if( is_array( $param) && isset( $param['_function'] ) )
            $isFunction = true;

        return $isFunction;
    }
483233
private static function paramValidator($param, $type)
    {
        $allowedTypes = explode('|', $type);

        foreach ($allowedTypes as $allowedType) {
            $validationFunction = 'is_' . $allowedType;
            if ($validationFunction($param)) {
                return true;
            }
        }

        return false;
    }
688187
public static function resource($value, $type = null): bool
    {
        if ($type !== null) {
            return is_resource($value) && $type === get_resource_type($value);
        }

        return is_resource($value);
    }
598271
private function initRequestParams($type, $params)
	{

		$list = self::$customParams;
		if (!isset($list[$type])) {
			throw new GatewayException('Undefined request type');
		}

		$list = $list[$type];
		$requestParams = array();

		foreach ($list as $key) {
			if (!empty($params[$key])) {
				$requestParams[$key] = trim($params[$key]);
			}
		}

		foreach (Config::getAll() as $key => $value) {
			if(
				in_array($type, array('complete', 'refund')) &&
				in_array($key, array('callbackUrl', 'callbackEmail', 'shopUrl'))
			){
				continue;
			}
			$requestParams[$key] = $value;
		}

		$requestParams = $this->convert($requestParams);

		if($type !== 'callback'){
			$requestParams['time'] = time();
		}

		$requestParams['sign'] = $this->sign($type, $requestParams);

		return $requestParams;

	}