Title: Multiline array shapes with 'comments' · Issue #184 · phpstan/phpdoc-parser · GitHub
Open Graph Title: Multiline array shapes with 'comments' · Issue #184 · phpstan/phpdoc-parser
X Title: Multiline array shapes with 'comments' · Issue #184 · phpstan/phpdoc-parser
Description: Feature request For types that involve more complex associative arrays, it is nice to know what each of key/value pairs are for. Does there exist a way to have 'type comments' that allow you to insert comments/descriptions in multiline a...
Open Graph Description: Feature request For types that involve more complex associative arrays, it is nice to know what each of key/value pairs are for. Does there exist a way to have 'type comments' that allow you to ins...
X Description: Feature request For types that involve more complex associative arrays, it is nice to know what each of key/value pairs are for. Does there exist a way to have 'type comments' that allow yo...
Opengraph URL: https://github.com/phpstan/phpdoc-parser/issues/184
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Multiline array shapes with 'comments'","articleBody":"# Feature request\r\n\r\nFor types that involve more complex associative arrays, it is nice to know what each of key/value pairs are for. Does there exist a way to have 'type comments' that allow you to insert comments/descriptions in multiline array types?\r\n\r\nFor example, below is an associative array that has a bunch of expected key values, along with 'comments' to help describe what each key is for. Is there a standard for psalm to do this.\r\n\r\n```php\r\n/**\r\n *\r\n * @var array\u003c\r\n * string, // name of the rule\r\n * array{\r\n * params: array\u003c // list of parameters defined by the rule\r\n * array{\r\n * key: string, // the key used to identify the value in the POST\r\n * nullOK: bool, // the key used to identify the value in the POST\r\n * blankOK: bool, // whether the param's value can be an empty string\r\n * type: string, // the type of value\r\n * regExp?: string, // regular expression used for validation if the type is 'regex'\r\n * context?: string, // extra data required for validation (currenlty only used if type is 'signed')\r\n * name?: string, // human readable name for the param (used by error messages, defaults to 'key')\r\n * description?: string, // a description of the parameter\r\n * list?: bool, // whether the param's value is a list\r\n * delim?: string, // delimeter to split the list on (e.g. [val => 'this,is,a,list', delim => ','])\r\n * trim?: string, // whether to strip whitespace from elements in list\r\n * trimLevel?: string, // 0 to trim whitespace from beginning and end of items,\r\n * minErr?: int, // minimum length of the param's value\r\n * maxErr?: int, // maximum length of the param's value\r\n * allowedVals?: array, // a list of allowed values\r\n * blackList?: array // a list of blacklisted/blocked values\r\n * }>,\r\n * handlers: array\u003c\r\n * string, // name of the handler\r\n * array{\r\n * func: string, // the name of the function in the app's validator (e.g. '\\ESP\\app\\Validator::func')\r\n * extraArgs?: array, // any parameters that are not $action, $post, or $postIn - ORDER MATTERS\r\n * return?: bool // whether error's are returned as a json or an exception is thrown (defaults to false)\r\n * }>\r\n * }>\r\n */\r\npublic static $rules = [];\r\n```\r\nThis would be incredibly useful. Thanks!","author":{"url":"https://github.com/jlwoolf","@type":"Person","name":"jlwoolf"},"datePublished":"2023-04-05T14:47:50Z","url":"https://github.com/phpstan/phpdoc-parser/issues/184"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:431da485-2d4e-00fc-dcc2-a476d3d7f42a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A6A:1A78DD:17DDE3:215DE9:6B006651 |
| html-safe-nonce | c0828fc201ab83721799be7754db80427fc06165cd52ea63401316d43662af10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTZBOjFBNzhERDoxN0RERTM6MjE1REU5OjZCMDA2NjUxIiwidmlzaXRvcl9pZCI6IjM0NzE0NzY4NTQzMDc3MTA1NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 32efebd5d7acf900c63795f00a54cabcf1ecbb71af32173f56b86f430c028047 |
| hovercard-subject-tag | issue:1655786795 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpstan/phpdoc-parser/184/issue_layout |
| twitter:image | https://opengraph.githubassets.com/944d778f1f3a54855b23120b2b798d010f4d66c19236723df7c11abda3d3286e/phpstan/phpdoc-parser/issues/184 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/944d778f1f3a54855b23120b2b798d010f4d66c19236723df7c11abda3d3286e/phpstan/phpdoc-parser/issues/184 |
| og:image:alt | Feature request For types that involve more complex associative arrays, it is nice to know what each of key/value pairs are for. Does there exist a way to have 'type comments' that allow you to ins... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jlwoolf |
| hostname | github.com |
| expected-hostname | github.com |
| None | 25854482a1773a7c1ebb8be3d2bc1c6e61d82d78126be63b5044474a86d44d9e |
| turbo-cache-control | no-preview |
| go-import | github.com/phpstan/phpdoc-parser git https://github.com/phpstan/phpdoc-parser.git |
| octolytics-dimension-user_id | 16435710 |
| octolytics-dimension-user_login | phpstan |
| octolytics-dimension-repository_id | 111290081 |
| octolytics-dimension-repository_nwo | phpstan/phpdoc-parser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 111290081 |
| octolytics-dimension-repository_network_root_nwo | phpstan/phpdoc-parser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4f5c239e31f1f680e6bbc419ff92d774da616ec |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width