Файловый менеджер - Редактировать - /home/tuudkjt/globeasy/wp-content/plugins/reviewx/vendor/nahid/apiz/src/GraphQL/AbstractRequest.php
Назад
<?php namespace Rvx\Apiz\GraphQL; use Rvx\Apiz\Constants\GraphQLRequestType; abstract class AbstractRequest { protected array $variables = []; public abstract function query() : string; public function getVariables() : array { return $this->variables; } public function getType() : string { $query = \trim($this->query()); $words = \explode(' ', $query, 2); if (isset($words[0]) && isset($words[1])) { $type = \strtolower($words[0]); if ($type === GraphQLRequestType::QUERY || $type === GraphQLRequestType::MUTATION) { return $type; } } throw new \InvalidArgumentException('Invalid query type'); } public function getQuery() : array { $query = ['query' => $this->query()]; if (!empty($this->getVariables())) { $query['variables'] = $this->getVariables(); } return $query; } public function setVariables(array $variables) : self { $this->variables = $variables; return $this; } public function __toString() { return \json_encode($this->getQuery()); } }
| ver. 1.6 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка