@@ -28,7 +28,7 @@ final class SelectboxTree
2828 * | | iMac
2929 * | Windows
3030 *
31- * @param array<int, array{id: int|string, name: string, parentId : int|string|null}>|SelectboxItem[] $data
31+ * @param array<int, array{id: int|string, name: string, parent_id : int|string|null}>|SelectboxItem[] $data
3232 * @return array<int|string, string> (id => user haystack)
3333 */
3434 public function process (array $ data ): array
@@ -47,7 +47,6 @@ public function process(array $data): array
4747 if ($ this ->nameFormatter !== null ) {
4848 $ categoryItem ['name ' ] = $ this ->nameFormatter ->format ($ categoryItem ['name ' ]);
4949 }
50-
5150 $ categories [] = $ categoryItem ;
5251 }
5352
@@ -98,7 +97,7 @@ public function setNameFormatter(NameFormatter $nameFormatter): void
9897 * Build category tree to simple selectbox array.
9998 *
10099 * @param array<int, array{id: int|string, name: string, parent: int|string|null}>|null $categories
101- * @return array<int, array{name: string, level: int}>
100+ * @return array<int|string , array{name: string, level: int}>
102101 */
103102 private function serializeCategoriesToSelectbox (
104103 ?array $ categories ,
@@ -116,13 +115,6 @@ private function serializeCategoriesToSelectbox(
116115
117116 $ return = [];
118117 foreach ($ categories as $ catKey => $ category ) {
119- if (
120- array_key_exists ('id ' , $ category ) === false
121- || array_key_exists ('parent ' , $ category ) === false
122- || array_key_exists ('name ' , $ category ) === false
123- ) {
124- throw new \InvalidArgumentException ('Category " ' . $ catKey . '" must contain keys "id", "parent" and "name". ' );
125- }
126118 if ($ category ['parent ' ] === $ parent ) {
127119 if (isset ($ usedIds [$ category ['id ' ]]) === false ) {
128120 $ return [$ category ['id ' ]] = [
0 commit comments