パラメータのバリデート

@param  array $params
@return void
505360
private function _validateParameters ($params)
    {
        if (! isset($params[1])) {
            throw new \Exception('新しく生成するモデルクラス名を指定してください');
        }

        if (! defined('LIB')) {
            throw new \Exception('LIB 定数(libraryディレクトリパス)が指定されていません');
        }

        if (! defined('APP')) {
            throw new \Exception('APP定数が指定されていません');
        }


        $this->model_name = ucfirst(strtolower($params[1]));
        if (file_exists(LIB.'/'.APP.'/Model/'.$this->model_name.'Model.php')) {
            throw new \Exception('既にモデルクラスが存在します');
        }
    }
1215613
private function _validateParameters ($params)
    {
        // 引数の有無
        if (! isset($params[0])) {
            throw new \Exception('生成するコマンド名を指定してください');
        }

        // 既に存在するかどうか
        $params[0] = ucfirst($params[0]);
        if (file_exists(GARNET.DS.'Command'.DS.$params[0].'.php')) {
            throw new \Exception($params[0].' コマンドは既に存在しています');
        }
    }
1237513
private function cleanParams(array $params = [])
    {
        if (isset($params['project'])) {
            $apiProject = $this->client->project;
            $params['project_id'] = $apiProject->getIdByName($params['project']);
            unset($params['project']);
            if (isset($params['category'])) {
                $apiIssueCategory = $this->client->issue_category;
                $params['category_id'] = $apiIssueCategory->getIdByName($params['project_id'], $params['category']);
                unset($params['category']);
            }
        }
        if (isset($params['status'])) {
            $apiIssueStatus = $this->client->issue_status;
            $params['status_id'] = $apiIssueStatus->getIdByName($params['status']);
            unset($params['status']);
        }
        if (isset($params['tracker'])) {
            $apiTracker = $this->client->tracker;
            $params['tracker_id'] = $apiTracker->getIdByName($params['tracker']);
            unset($params['tracker']);
        }
        if (isset($params['assigned_to'])) {
            $apiUser = $this->client->user;
            $params['assigned_to_id'] = $apiUser->getIdByUsername($params['assigned_to']);
            unset($params['assigned_to']);
        }
        if (isset($params['author'])) {
            $apiUser = $this->client->user;
            $params['author_id'] = $apiUser->getIdByUsername($params['author']);
            unset($params['author']);
        }

        return $params;
    }
520862
public function setParams($params): void
    {
        if (! \is_array($params) && ! $params instanceof \ArrayAccess) {
            throw new \InvalidArgumentException('Event params are invalid. Expected type is array or \\ArrayAccess. Got ' . \gettype($params));
        }

        $this->params = $params;
    }
913116
protected function setParams(array $params) {
		parent::setParams($params);
		if($this->autoinc===true){
			$this->notNull=false;
		}
	}
805328
public function loadState(array $params)
    {
        //loads state from session
        $session = $this->getRememberSession();
        if ($session && $this->getPresenter()->isSignalReceiver($this)) {
            $session->remove();
        } elseif ($session && empty($params) && $session->params) {
            $params = (array) $session->params;
        }

        parent::loadState($params);
    }
811320
private function setter(array $parameters)
    {
        // Parse array and set values
        array_map(
            function($key, $value) {
                $this->set($key, $value);
            },
            array_keys($parameters),
            $parameters
        );
    }
1294370
public function save(array $params)
    {
        foreach ($params as $method => $param) {
            if (is_array($param) && isset($param[0])) {
                call_user_func_array([$this, $method], $param);
            } else {
                $this->{$method}($param);
            }
        }
    }
1048515
private function setCostFromParams(array $params)
    {
        $cost = (int)$this->getMatchingData($params, '/^[0-9]{1,2}$/');
        $this->cost = (! empty($cost)) ? (string)$cost : self::DEFAULT_COST;
    }
981591
protected function setTHead(&$params)
    {
        $k = $this->getColumnIndex($params);

        if (isset($params['parent'])) {
            $this->theadChild[] = [
                'title' => $params['title'],
                'class' => isset($params['className']) ? $params['className'] : null,
                'colspan' => 1,
            ];
            $this->thead[$k]['colspan'] = !isset($this->thead[$k]['colspan']) ? 1 : ($this->thead[$k]['colspan']+1);
            $this->thead[$k]['title']   = $params['parent'];
            $this->header = true;
        } else {
            if (isset($params['title'])) {
                $this->thead[$k]['title']   = $params['title'];
            }
            if (isset($params['className'])) {
                $this->thead[$k]['class'] = $params['className'];
            }
        }
    }
726073
public function setParams(array $params = [])
    {

        //Process Params
        $params = $this->processParams($params);

        //Set the params
        $this->params = $params;

        return $this;
    }
1233507
public function setParameters(array $params): self
    {
        foreach ($params as $key => $value) {
            $this->parameters[$key] = $value;
        }
        return $this;
    }
1019040
public function setParametersAttribute($parameters)
    {
        if (is_array($parameters)) {
            $this->attributes['parameters'] = json_encode($parameters);
        } else {
            $this->attributes['parameters'] = $parameters;
        }
    }
581417
protected function setFromTypes(array $params)
    {
        if (count($params) != count($this->valueMap)) {
            $numParams = count($params);
            $expectedParams = count($this->valueMap);
            throw new \InvalidArgumentException("Expected {$expectedParams} parameters, got {$numParams}");
        }
        
        foreach ($params as $key => $value) {
            if (is_object($value)) {
                if (!$value instanceof $this->valueMap[$key]['class']) {
                    $c = get_class($value);
                    throw new \InvalidArgumentException("Invalid Type ({$c}) at position {$key}");
                }
                $this->value[$this->valueMap[$key]['name']] = clone $value;
                continue;
            }
            $t = gettype($value);
            if ($t != $this->valueMap[$key]['class']) {
                throw new \InvalidArgumentException("Invalid Type ({$t}) at position {$key}");
            }
            $this->value[$this->valueMap[$key]['name']] = $value;
        }
    }
665364
public function setUrlParams(array $params) {
		foreach ($params as $param => $value) {
			$this->setUrlParam($param, $value);
		}
		
		return $this;
	}
1267215
protected function prepareParams(array $params)
    {
        $result = $params;

        foreach ($result as $key => $val) {
            if (is_bool($val)) {
                $result[$key] = $val ? 1 : 0;
            }
        }

        return $result;
    }
506889
protected function setParams(array $params) {
		parent::setParams($params);
		$ref = $this->relative ? str_replace('(%s)://', '(?:(%s)://)?', $this->ref) : $this->ref;
		$this->ref = sprintf($ref, implode('|', $this->protocols));
	}