originalInput = $params; $params = array_change_key_case($params, CASE_LOWER); $params += [ 'query' => null, 'queryid' => null, 'documentid' => null, // alias to queryid 'operation' => null, 'variables' => null ]; $instance->query = $params['query']; $instance->queryId = $params['queryid'] ?: $params['documentid']; $instance->operation = $params['operation']; $instance->variables = $params['variables']; $instance->readOnly = (bool) $readonly; return $instance; } /** * @return array */ public function getOriginalInput() { return $this->originalInput; } /** * @return bool */ public function isReadOnly() { return $this->readOnly; } }