Skip to content

Commit

Permalink
Typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 20, 2024
1 parent 4623276 commit 39c950a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
16 changes: 8 additions & 8 deletions batch/apispec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/conference.php
Original file line number Diff line number Diff line change
Expand Up @@ -5039,7 +5039,7 @@ private function pc_json_item($viewer, $user, $flags) {
}

/** @param int $flags
* @return array<string,mixed> */
* @return object */
function hotcrp_pc_json(Contact $viewer, $flags) {
if (!$viewer->isPC) {
$flags &= ~(self::PCJ_EMAIL | self::PCJ_UID);
Expand Down
3 changes: 2 additions & 1 deletion src/listaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 39c950a

Please sign in to comment.