{"action":"created","issue":{"url":"https://api.github.com/repos/docbook/docbook/issues/91","repository_url":"https://api.github.com/repos/docbook/docbook","labels_url":"https://api.github.com/repos/docbook/docbook/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/docbook/docbook/issues/91/comments","events_url":"https://api.github.com/repos/docbook/docbook/issues/91/events","html_url":"https://github.com/docbook/docbook/issues/91","id":225733922,"number":91,"title":"Allow types (when used in method and function) to be more than 1 type.","user":{"login":"rquadling","id":12801,"avatar_url":"https://avatars3.githubusercontent.com/u/12801?v=4","gravatar_id":"","url":"https://api.github.com/users/rquadling","html_url":"https://github.com/rquadling","followers_url":"https://api.github.com/users/rquadling/followers","following_url":"https://api.github.com/users/rquadling/following{/other_user}","gists_url":"https://api.github.com/users/rquadling/gists{/gist_id}","starred_url":"https://api.github.com/users/rquadling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rquadling/subscriptions","organizations_url":"https://api.github.com/users/rquadling/orgs","repos_url":"https://api.github.com/users/rquadling/repos","events_url":"https://api.github.com/users/rquadling/events{/privacy}","received_events_url":"https://api.github.com/users/rquadling/received_events","type":"User","site_admin":false},"labels":[{"id":521206415,"url":"https://api.github.com/repos/docbook/docbook/labels/accepted","name":"accepted","color":"0e8a16","default":false},{"id":396922296,"url":"https://api.github.com/repos/docbook/docbook/labels/v52","name":"v52","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-05-02T15:35:03Z","updated_at":"2018-04-30T10:43:01Z","closed_at":null,"author_association":"NONE","body":"Hi.\r\n\r\nComing from PHP, specifically PHP 7.1 where the concept of union types are supported.\r\n\r\nCurrently, where a method may return more than 1 type - commonly a boolean false and some other type, this is documented as `mixed`.\r\n\r\nFor example:\r\n\r\n`mixed strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )`\r\n\r\nThis is rendered from this docbook snippet:\r\n```xml\r\n  <methodsynopsis>\r\n   <type>mixed</type><methodname>strpos</methodname>\r\n   <methodparam><type>string</type><parameter>haystack</parameter></methodparam>\r\n   <methodparam><type>mixed</type><parameter>needle</parameter></methodparam>\r\n   <methodparam choice=\"opt\"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>\r\n  </methodsynopsis>\r\n```\r\n\r\nThe result for this function will either be a boolean `false` or a positive integer, but as a single `<type>` is allowed, `<type>mixed</type>` is what we are currently using.\r\n\r\nIt would be useful to enhance docbook to allow for multiple types for `<methodsynopsis>` and `<methodparam>`.\r\n\r\nSo, my proposal is a new tag of `<types>` that allows for 2 or more `<type>`.\r\n\r\n```\r\nmethodsynopsis ::=\r\n\tSequence of:\r\n\t\tZero or more of:\r\n\t\t\tmodifier\r\n\t\tOptionally one of:\r\n\t\t\ttype\r\n\t\t\ttypes\r\n\t\t\t\tTwo or more of:\r\n\t\t\t\t\ttype\r\n\t\t\tvoid\r\n\t\tmethodname\r\n\t\tOne of:\r\n\t\t\tOne or more of:\r\n\t\t\t\tgroup (db.group.methodparam)\r\n\t\t\t\tmethodparam\r\n\t\t\tvoid\r\n\t\tZero or more of:\r\n\t\t\texceptionname\r\n\t\tZero or more of:\r\n\t\t\tmodifier\r\n```\r\n\r\nand\r\n\r\n```\r\nmethodparam ::=\r\n\tSequence of:\r\n\t\tZero or more of:\r\n\t\t\tmodifier\r\n\t\tOptionally one of\r\n\t\t\ttype\r\n\t\t\ttypes\r\n\t\t\t\tTwo or more of:\r\n\t\t\t\t\ttype\r\n\t\tOne of:\r\n\t\t\tSequence of:\r\n\t\t\t\tZero or more of:\r\n\t\t\t\t\tmodifier\r\n\t\t\t\tparameter\r\n\t\t\t\tinitializer?\r\n\t\t\tfuncparams\r\n\t\tZero or more of:\r\n\t\t\tmodifier\r\n```\r\n\r\nIf there are other places where a `<type>` is defined, these may also need to be expanded to allow for multiple types.\r\n\r\nIf there is no way to require 2 or more of a child tag, then 1 or more would be fine, and would make `<type>int</type>` the same as `<types><type>int</type></types>`.\r\n\r\nI'm happy to make a proper pull request if pointed in the right direction."},"comment":{"url":"https://api.github.com/repos/docbook/docbook/issues/comments/385364103","html_url":"https://github.com/docbook/docbook/issues/91#issuecomment-385364103","issue_url":"https://api.github.com/repos/docbook/docbook/issues/91","id":385364103,"user":{"login":"rquadling","id":12801,"avatar_url":"https://avatars3.githubusercontent.com/u/12801?v=4","gravatar_id":"","url":"https://api.github.com/users/rquadling","html_url":"https://github.com/rquadling","followers_url":"https://api.github.com/users/rquadling/followers","following_url":"https://api.github.com/users/rquadling/following{/other_user}","gists_url":"https://api.github.com/users/rquadling/gists{/gist_id}","starred_url":"https://api.github.com/users/rquadling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rquadling/subscriptions","organizations_url":"https://api.github.com/users/rquadling/orgs","repos_url":"https://api.github.com/users/rquadling/repos","events_url":"https://api.github.com/users/rquadling/events{/privacy}","received_events_url":"https://api.github.com/users/rquadling/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T10:43:01Z","updated_at":"2018-04-30T10:43:01Z","author_association":"NONE","body":"https://ceylon-lang.org/documentation/1.3/tour/types/ Documents intersection and union types.\r\n\r\nThe use case I came here with was only union types.\r\n\r\nCurrently, PHP doesn't have any direct support for intersection types (an interesting idea that could be implemented in userland code).\r\n"}}
{"actor":{"display_login":"rquadling"}}