*/ public static function CollectionRules(ParameterMeta $parameter, RuleFactory $factory): array { if (is_null($parameter->tag)) { return []; } $type = $parameter->tag->getType(); if (!$type instanceof Generic) { return []; } $subtypes = $type->getTypes(); if (count($subtypes) == 0) { return ['' => ['array']]; } $subtype = count($subtypes) == 1 ? $subtypes[0] : $subtypes[1]; return $factory->mergeRules( ['' => ['array']], $factory->getRulesFromDocBlock($subtype, '.*'), ); } }