diff --git a/batch/apispec.php b/batch/apispec.php index df3b9c8c59..c7c5344819 100644 --- a/batch/apispec.php +++ b/batch/apispec.php @@ -69,17 +69,17 @@ function __construct(Conf $conf, $arg) { $this->api_map = $conf->expanded_api_map(); $this->j = (object) []; + $this->setj_schemas = (object) []; + $this->setj_parameters = (object) []; + $this->setj_tags = (object) []; $this->setj = (object) [ "paths" => (object) [], "components" => (object) [ - "schemas" => (object) [], - "parameters" => (object) [] + "schemas" => $this->setj_schemas, + "parameters" => $this->setj_parameters ], - "tags" => (object) [] + "tags" => $this->setj_tags ]; - $this->setj_schemas = $this->setj->components->schemas; - $this->setj_parameters = $this->setj->components->parameters; - $this->setj_tags = $this->setj->tags; $this->description_map = []; foreach ([["?devel/apidoc/*.md"], $conf->opt("apiDescriptions")] as $desc) { @@ -318,7 +318,7 @@ private function expand_path_method($path, $method, $known, $uf) { $this->expand_response($xj, $uf); } - /** @param object $x + /** @param object $xj * @param object $uf * @param string $path */ private function expand_metadata($xj, $uf, $path) { @@ -691,7 +691,7 @@ private function sort() { $this->tag_order = []; foreach ($this->j->tags ?? [] as $i => $x) { if (isset($x->name) && is_string($x->name)) { - $p = array_search(self::$default_tag_order, $x->name); + $p = array_search($x->name, self::$default_tag_order); if ($p === false) { $p = count(self::$default_tag_order) + $i; } diff --git a/src/conference.php b/src/conference.php index cb89a80a70..a87d6598bb 100644 --- a/src/conference.php +++ b/src/conference.php @@ -5039,7 +5039,7 @@ private function pc_json_item($viewer, $user, $flags) { } /** @param int $flags - * @return array */ + * @return object */ function hotcrp_pc_json(Contact $viewer, $flags) { if (!$viewer->isPC) { $flags &= ~(self::PCJ_EMAIL | self::PCJ_UID); diff --git a/src/listaction.php b/src/listaction.php index ca42f9fb06..53f20de84e 100644 --- a/src/listaction.php +++ b/src/listaction.php @@ -94,7 +94,8 @@ static private function do_call($name, Contact $user, Qrequest $qreq, $selection } } if (!$uf) { - $cs->reset_context()->set_require_key_for_method(null); + $cs->reset_context(); + $cs->xtp->set_require_key_for_method(null); $uf1 = $cs->get($name); if ($uf1) { return JsonResult::make_error(405, "<0>Method not supported");