From 692f3a715a4619dd5ee1686e591fb24858ac2e6f Mon Sep 17 00:00:00 2001 From: Even Allmighty <1392145+even-allmighty@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:36:55 +0000 Subject: [PATCH 1/3] Allow searching iterations by title and/or cadence title --- src/Api/Groups.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Api/Groups.php b/src/Api/Groups.php index 5a97e0cf..219a36ec 100644 --- a/src/Api/Groups.php +++ b/src/Api/Groups.php @@ -796,6 +796,16 @@ public function iterations($group_id, array $parameters = []) ->setDefault('include_ancestors', true) ; + $resolver->setDefined('search'); + + $resolver->setDefined('in') + ->setAllowedTypes('in', 'array') + ->setAllowedValues('in', function (array $value) { + return \count($value) === \count(\array_filter($value, function ($item) { + return \is_string($item) && in_array($item, ['title', 'cadence_title']); + })); + }); + return $this->get('groups/'.self::encodePath($group_id).'/iterations', $resolver->resolve($parameters)); } From 014a5b1f96d05f4bfcbf4bd0b8b0d8a0853eb0ae Mon Sep 17 00:00:00 2001 From: Even Allmighty <1392145+even-allmighty@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:39:42 +0000 Subject: [PATCH 2/3] Fix CI: Force global namespace --- src/Api/Groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Groups.php b/src/Api/Groups.php index 219a36ec..4d5c738a 100644 --- a/src/Api/Groups.php +++ b/src/Api/Groups.php @@ -802,7 +802,7 @@ public function iterations($group_id, array $parameters = []) ->setAllowedTypes('in', 'array') ->setAllowedValues('in', function (array $value) { return \count($value) === \count(\array_filter($value, function ($item) { - return \is_string($item) && in_array($item, ['title', 'cadence_title']); + return \is_string($item) && \in_array($item, ['title', 'cadence_title']); })); }); From 8cb2c86da201c25dc6f7aa0e396eae9af73f80ad Mon Sep 17 00:00:00 2001 From: Even Allmighty <1392145+even-allmighty@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:54:34 +0000 Subject: [PATCH 3/3] Fix CI: Strict checking of in_array --- src/Api/Groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Groups.php b/src/Api/Groups.php index 4d5c738a..0a34c0e6 100644 --- a/src/Api/Groups.php +++ b/src/Api/Groups.php @@ -802,7 +802,7 @@ public function iterations($group_id, array $parameters = []) ->setAllowedTypes('in', 'array') ->setAllowedValues('in', function (array $value) { return \count($value) === \count(\array_filter($value, function ($item) { - return \is_string($item) && \in_array($item, ['title', 'cadence_title']); + return \is_string($item) && \in_array($item, ['title', 'cadence_title'], true); })); });