Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full function signature in rST (functions & methods) #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

n-peugnet
Copy link

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

The only part we need to strip from the signature is the 'function' one, sphinxcontrib-phpdomains handles pretty well the rest of the signature.
This adds a lot more details to the docs, by showing where the parameters are, their default values and the optional return value Type hint.

This also allows to visually differentiate instance methods from class
methods.

Example

class SphinxInventoryParser {

	/**
	 * 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.
	 */
	public function parse($stream, string $baseURI = ''): SphinxInventory {

Before:

2023-04-04-184449_718x515_scrot

After:

2023-04-04-184418_718x515_scrot

The only part we need to strip from the signature is the 'function' one,
sphinxcontrib-phpdomains handles pretty well the rest of the signature.
This adds a lot more details to the docs, by showing where the
parameters are, their default values and the optional return value Type
hint.

This also allows to visually differentiate instance methods from class
methods.
@n-peugnet n-peugnet marked this pull request as ready for review April 4, 2023 16:42
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