Sets a new param type

@param   string      $param_name
@param   ?string     $php_type
@param   string      $new_type
@param   string      $phpdoc_type
@param   bool        $is_php_compatible

@return  void
976292
public function setParamType($param_name, $php_type, $new_type, $phpdoc_type, $is_php_compatible)
    {
        $new_type = str_replace(['<mixed, mixed>', '<array-key, mixed>', '<empty, empty>'], '', $new_type);

        if ($php_type) {
            $this->new_php_param_types[$param_name] = $php_type;
        }
        $this->new_phpdoc_param_types[$param_name] = $phpdoc_type;
        $this->new_psalm_param_types[$param_name] = $new_type;
        $this->param_type_is_php_compatible[$param_name] = $is_php_compatible;
    }
439625
public function setParam($param): void
    {
        // prepare params data
        // setup param types
        if (strpos($param, '$') === false) {
            return;
        }

        [$type, $key] = preg_split('/[ $]+/', $param);

        $this->params[$key] = trim($type);
    }
820904
public function setBody($body, $content_type = false){
	
		// clear old body data
		$this->post->clear();
		$this->files->clear();
		
		// is this form data?
		if(is_array($body)){
			$body = http_build_query($body);
		}
		
		$this->body = (string)$body;
		
		// plain text should be: text/plain; charset=UTF-8
		if($content_type){
			$this->headers->set('content-type', $content_type);
		}
		
		// do it!
		$this->prepare();
	}
316824
def setContent(self, type_, value):
        

        if type_ in [self.CONTENT_TYPE_TXT, self.CONTENT_TYPE_URL,
                     self.CONTENT_TYPE_FILE]:
            if type_ == self.CONTENT_TYPE_FILE:
                self._file = {}
                self._file = {'doc': open(value, 'rb')}
            else:
                self.addParam(type_, value)
936675
public function add($_type = null)
    {
        if (empty($this->Settings['formFields'])) {
            $columns = $this->Model->schema()->columns();
            $filter = Configure::read('PostTypes.FilteredColumns');
            foreach ($columns as $column) {
                if (!in_array($column, $filter)) {
                    $this->Settings['formFields'][$column] = [];
                }
            }
        }

        // setting up an event for the add
        $_event = new Event('Controller.PostTypes.beforeAdd.' . $this->_type, $this, [
        ]);
        $this->eventManager()->dispatch($_event);

        $type = $this->Model->newEntity();
        if ($this->request->is('post')) {
            $type = $this->Model->newEntity($this->request->data);
            if ($this->Model->save($type)) {
                $this->Flash->success(__('The {0} has been saved.', [$this->Settings['type']]));
                return $this->redirect(['action' => 'index', 'type' => $this->_type]);
            } else {
                $this->Flash->error(__('The {0} could not be saved. Please, try again.', [$this->Settings['type']]));
            }
        }
        $this->set(compact('type'));

        // setting up an event for the add
        $_event = new Event('Controller.PostTypes.afterAdd.' . $this->_type, $this, [
        ]);
        $this->eventManager()->dispatch($_event);

        if (!$this->Settings['views']['add']) {
            $this->render(Configure::read('PostTypes.AdminPostTypeViews.add'));
            return;
        }

        $this->render($this->Settings['views']['add']);
    }
1261825
public function bind_param($types, &$var1, &$_ = NULL, $stmt, $types, &$var1, &$_ = NULL)
    {
    }
1048020
public function bindParam($paramno, &$param, $type = null, $maxlen = null, $driverdata = null)
    {
        $log = 'Binding Parameters: ' . $paramno . '=' . $param;
        if (!is_null($type)) {
            $log .= '| Type: ' . $type;
        }
        if (!is_null($maxlen)) {
            $log .= '| Maxlen: ' . $maxlen;
        }

        if (!is_null($driverdata)) {
            $log .= '| DriverData: ' . $driverdata;
        }
        $this->connection->writeToLog($log);

        if (!empty($type)) {
            return parent::bindParam($paramno, $param, $type, $maxlen, $driverdata);
        }

        return parent::bindParam($key, $val);
    }
524276
public function addFormField($type, $params = array()) {
    $namespace = "\\iJos\\iForms\\Fields\\" . ucfirst($type);
    $field = new $namespace( $params );
    array_push($this -> form_fields, $field);
  }
275662
protected function _setParameter($type, $name, $value)
    {
        $parray = array();
        $type = strtolower($type);
        switch ($type) {
            case 'get':
                $parray = &$this->paramsGet;
                break;
            case 'post':
                $parray = &$this->paramsPost;
                if ( $value === null ) {
                    if (isset($this->body_field_order[$name]))
                        unset($this->body_field_order[$name]);
                } else {
                    $this->body_field_order[$name] = self::VTYPE_SCALAR;
                }
                break;
        }

        if ($value === null) {
            if (isset($parray[$name])) unset($parray[$name]);
        } else {
            $parray[$name] = $value;
        }
    }
278151
protected function __init_database($param = null)
    {

        if ($this->_default_database_type == '') {
            $this->_default_database_type = Config::get('default_database_type');
        }

        if (isset($param['type']) && is_string($param['type'])) {
            $this->database_type = $param['type'];
        } else {
            $this->database_type = $this->_default_database_type;
        }


        switch (true) {
            case ($this->db instanceof Mysql):
                return true;
            case ($this->db instanceof CouchDB):
                return true;
            case ($this->db instanceof Mongo):
                return true;
        }


        try {
            switch ($this->database_type) {
                case 'mysql':
                    $master_param = new MysqlConnection([
                        'host'     => (string)Config::get('db_host'),
                        'username' => (string)Config::get('db_user'),
                        'password' => (string)Config::get('db_pass'),
                        'database' => (string)Config::get('db_name'),
                        'port'     => (string)Config::get('db_port')
                    ]);

                    $this->db = new Mysql($master_param);
                    break;
                case 'couchdb':
                    $this->db = new CouchDB();
                    break;
                case 'mongo':
                    break;
            }

        } catch (DatabaseException $e) {
            throw $e;
        }

        return true;
    }
1201845
private function createType(DocType $type, bool $nullable, string $docType = null): ?Type
    {
        $docType = $docType ?? (string) $type;

        if ($type instanceof Collection) {
            list($phpType, $class) = $this->getPhpTypeAndClass((string) $type->getFqsen());

            $key = $this->getTypes($type->getKeyType());
            $value = $this->getTypes($type->getValueType());

            // More than 1 type returned means it is a Compound type, which is
            // not handled by Type, so better use a null value.
            $key = 1 === \count($key) ? $key[0] : null;
            $value = 1 === \count($value) ? $value[0] : null;

            return new Type($phpType, $nullable, $class, true, $key, $value);
        }

        // Cannot guess
        if (!$docType || 'mixed' === $docType) {
            return null;
        }

        if ('[]' === substr($docType, -2)) {
            if ('mixed[]' === $docType) {
                $collectionKeyType = null;
                $collectionValueType = null;
            } else {
                $collectionKeyType = new Type(Type::BUILTIN_TYPE_INT);
                $collectionValueType = $this->createType($type, $nullable, substr($docType, 0, -2));
            }

            return new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, $collectionKeyType, $collectionValueType);
        }

        $docType = $this->normalizeType($docType);
        list($phpType, $class) = $this->getPhpTypeAndClass($docType);

        if ('array' === $docType) {
            return new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, null, null);
        }

        return new Type($phpType, $nullable, $class);
    }
1256512
public function bindColumn($column, &$param, $type = null)
    {
        if ($type === null) :
            $this->_statement->bindColumn($column, $param);
        else :
            $this->_statement->bindColumn($column, $param, $type);
        endif;
    }
151838
public function bindValue($parameter, $value, $data_type = \PDO::PARAM_STR) {
        $this->_debugBindValues[$parameter] = $value;
        parent::bindValue($parameter, $value, $data_type);
    }
1328286
protected function addParamTypeFailure($fileName, $fileLine, $calledFunction, $parameterNumber, $parameterName, $expectedType, $calledType)
    {
        $data = 'Invalid type calling ' . $calledFunction . ' : parameter ' . $parameterNumber  . ' (' . $parameterName . ') should be of type ' . $expectedType . ' but got ' . $calledType . ' instead';
        $this->reportFailure($fileName, $fileLine, $data);
    }
1289262
public function addParam($name, $type = null)
    {
        $this->params[(string)$name] = $type;
        return $this;
    }
17345
public function setType($type = self::TYPE_TEXT) {
		if (!in_array($type, array(self::TYPE_TEXT, self::TYPE_HTML))) {
			throw new MailException('invalid type: ' . $type);
		}
		$this->type = $type;
	}
724560
def new_param(name, type, value, start = None, scale = None, unit = None, dataunit = None, comment = None):
	
	elem = Param()
	elem.Name = name
	elem.Type = type
	elem.pcdata = value
	# FIXME:  I have no idea how most of the attributes should be
	# encoded, I don't even know what they're supposed to be.
	if dataunit is not None:
		elem.DataUnit = dataunit
	if scale is not None:
		elem.Scale = scale
	if start is not None:
		elem.Start = start
	if unit is not None:
		elem.Unit = unit
	if comment is not None:
		elem.appendChild(ligolw.Comment())
		elem.childNodes[-1].pcdata = comment
	return elem