Skip to content

Better support for @return and @throws#19

Open
n-peugnet wants to merge 1 commit intoavalanche123:masterfrom
club-1:n-peugnet-throws
Open

Better support for @return and @throws#19
n-peugnet wants to merge 1 commit intoavalanche123:masterfrom
club-1:n-peugnet-throws

Conversation

@n-peugnet
Copy link

@n-peugnet n-peugnet commented Apr 4, 2023

Example

	/**
	 * Parse a readable stream into an indexed :php:class:`SphinxInventory` object.
	 *
	 * @param resource	$stream		The resource to parse, opened in read mode.
	 * @param string	$baseURI	The base string to prepend to an object's location to get its final URI.
	 *
	 * @return SphinxInventory		The inventory parsed from the stream.
	 * @throws UnexpectedValueException	If an unexpected value is encountered while parsing.
	 */

Before:

2023-04-04-144333_627x518_scrot

After:

2023-04-04-144251_627x518_scrot

JSON diff:

--- before.json	2023-04-04 14:49:01.314363680 +0200
+++ after.json	2023-04-04 14:49:24.822424985 +0200
@@ -47,20 +47,18 @@
       {
         "type": "return",
         "types": [
           "SphinxInventory"
         ],
-        "name": "he",
-        "description": "inventory parsed from the stream."
+        "description": "The inventory parsed from the stream."
       },
       {
         "type": "throws",
         "types": [
           "UnexpectedValueException"
         ],
-        "name": "f",
-        "description": "an unexpected value is encountered while parsing."
+        "description": "If an unexpected value is encountered while parsing."
       }
     ],
     "description": "Parse a readable stream into an indexed :php:class:`SphinxInventory` object.",
     "isPrivate": false,
     "isProtected": false,

- Correctly parse Type and optional description components
  See <https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/throws.html>
  and <https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/return.html>
- Better rST rendering by outputting throws type and rtype field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant